Reputation: 1142
In my app I want to open a MapActivity
from a button click. But on the button click,its showing a class not found error.
Im posting my error log also,so that it will be easy to correct me...
06-11 17:16:53.854: WARN/dalvikvm(890): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): FATAL EXCEPTION: main
06-11 17:16:53.865: ERROR/AndroidRuntime(890): java.lang.NoClassDefFoundError: com.iqmobi.SampleMapPage
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at com.iqmobi.Login.onClick(Login.java:61)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at android.view.View.performClick(View.java:2408)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at android.view.View$PerformClick.run(View.java:8816)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at android.os.Handler.handleCallback(Handler.java:587)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at android.os.Handler.dispatchMessage(Handler.java:92)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at android.os.Looper.loop(Looper.java:123)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at android.app.ActivityThread.main(ActivityThread.java:4627)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at java.lang.reflect.Method.invokeNative(Native Method)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at java.lang.reflect.Method.invoke(Method.java:521)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-11 17:16:53.865: ERROR/AndroidRuntime(890): at dalvik.system.NativeStart.main(Native Method)
06-11 17:16:53.874: WARN/ActivityManager(60): Force finishing activity com.iqmobi/.Login
06-11 17:16:54.384: WARN/ActivityManager(60): Activity pause timeout for HistoryRecord{4505c5d8 com.iqmobi/.Login}
The code which is moving to the MapActivity is
Intent successIntent=new Intent(Login.this,SampleMapPage.class);
startActivity(successIntent);
An additional information i checked,that,when i Toast instead of startActivity in my above code section,its working....Its something related to the button click,i think.....please help
Upvotes: 0
Views: 249
Reputation: 38876
Add <uses-library android:name="com.google.android.maps" />
to your manifest and make sure you're using the Google API version of Android. Your manifest should look something like the one in this question.
Upvotes: 1
Reputation: 22291
Write Below Code line into your manifest file's <application>
tag.
<uses-library android:name="com.google.android.maps" />
Upvotes: 1