开发者

refactoring problem with one of my classes

开发者 https://www.devze.com 2023-03-28 19:16 出处:网络
i开发者_如何学C wrote a program and i named my class StatusListActivity which extend Activityand is the launcher and main class. I tried refactoring it bychanging the name to something else and whenev

i开发者_如何学C 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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号