0
I have a problem in my Android project on Eclipse. After implementing the functionalities, I reached a total of 10 activities and 8 other classes. From there I realized the need to structure the code and created child packages within the project package:
Remembering that in order for Eclipse to display packages in this way I changed the view mode of packages to display by hierarchy.
Inside the activities package I put all the activities of the project. When saving everything and running I get the following error:
01-03 19:59:59.630: E/AndroidRuntime(361): FATAL EXCEPTION: main
01-03 19:59:59.630: E/AndroidRuntime(361): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.meu_projeto/com.example.meu_projeto.MainActivity}: java.lang.ClassNotFoundException: com.example.meu_projeto.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.meu_projeto-1.apk]
01-03 19:59:59.630: E/AndroidRuntime(361): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
I’ve tried to make that change in Androidmanifest.xml:
Before:
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Then I changed this line:
android:name=".activities.MainActivity"
But it didn’t help, someone can help?
Place an image of the folder structure
/src/
– ramaral
Okay I’ll put.
– Gustavo Almeida Cavalcante
Ready put the image, I hope someone can answer because I have not found the solution of this yet.
– Gustavo Almeida Cavalcante
Rename all folders with
com.example.meu_projeto.
in front. Example the tasks folder would be:com.example.meu_projeto.tasks
– user28595
But they are renamed this way, the Eclipse shows that way because I put to display hierarchically.
– Gustavo Almeida Cavalcante
You can add the full androidmanifest?
– user28595
@Diego Felipe already solved thanks to the solution of Jackowski and with the help of your comment thank you.
– Gustavo Almeida Cavalcante