我的一门课的重构问题

发布于 2024-11-30 08:42:33 字数 118 浏览 1 评论 0原文

我编写了一个程序,并将我的类 StatusListActivity 命名为“扩展 Activity”,并且是启动器和主类。我尝试通过将名称更改为其他名称来重构它,每当我尝试运行该应用程序时,它都会关闭,请您知道问题是什么。

i wrote a program and i named my class StatusListActivity which extend Activity and is the launcher and main class. I tried refactoring it by changing the name to something else and whenever i tried to run the application, it closes please do you have an idea of what the problem was.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

茶花眉 2024-12-07 08:42:33

我猜你正在为 Android 开发?在这种情况下,您可能已更改默认启动器活动,您必须在项目的部署选项中重置该活动。

另外,您必须注意,通过简单地重命名函数,您并没有更改代码本身的任何引用。为此,您必须使用适当的重构功能,例如 Eclipse 在“重构”菜单中提供的功能。

I guess you are developing for Android? In that case, you might have changed the default launcher activity, which you have to reset in the deployment options of your project.

Also, you have to be aware, that by simply renaming a function, you have not changed any references on the code itself. For that, you have to use a proper refactoring-function as e.g. provided by Eclipse in the "Refactor"-Menu.

时光无声 2024-12-07 08:42:33

尝试更改 AndroidManifest.xml 文件中 Activity 类的名称

编辑< br>
另外,如果活动位于 com.example.myproject.activities.MyActivity
并在清单文件中
清单中的内容必须是

这对于必须位于 AndroidManifest.xml 中的所有其他类也是如此

Try to change the name of the Activity class in your AndroidManifest.xml file

<activity android:name="activityNewName">

EDIT
Also if activity located in com.example.myproject.activities.MyActivity
and in manifest file <manifest package="com.example.myproject" ...>
than in manifest must be <activity android:name=".activities.MyActivity">

this also true for all other classes that must be in AndroidManifest.xml

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文