Description of problem:
So I have a Main class in the package com.main, the Main.java class contains a button,
package com.main;
public class Main extends Activity {
...
public void onClick(View v) {
switch(v.getId())
{
case R.id.btnsuivant:
Intent intent = new Intent(this, Adddetail.class);
//intent.putExtra("Bonjour3","Bonjour4");
this.startActivity(intent);
break;
}
}
...
}
this button that launches a new mapActivity (Adddetail.java).
package com.main;
public class Adddetail extends MapActivity {
... //error-free
}
and I use:
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".Adddetail"
android:label="Détails Publication" >
</activity>
When at run I click the button then the execution stops and shows me the following error:
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.main.Adddetail
at com.main.Main.onClick(Main.java:486)
at android.view.View.performClick(View.java:3511)
at android.view.View$PerformClick.run(View.java:14105)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
PS: When I use the same code for the mapActivity in the Main class it works.
thank you for those who will help me, those who will try to help me and those who will think only has helped me.