我有一個主菜單的圖片說播放,導致水平選擇菜單。一旦你通過主菜單並繼續選擇一個級別,它會崩潰並給出這個錯誤。我的意圖與我在主菜單中完全一樣。任何一個能夠幫助我弄清楚爲什麼這會一直崩潰?我的應用程序崩潰,只要我啓動一個意圖開始一個新的活動
04-02 07:40:38.284: D/dalvikvm(1272): GC_FOR_ALLOC freed 324K, 5% free 16316K/17076K, paused 70ms, total 72ms
04-02 07:40:38.423: I/Choreographer(1272): Skipped 2446 frames! The application may be doing too much work on its main thread.
04-02 07:40:39.213: I/Choreographer(1272): Skipped 141 frames! The application may be doing too much work on its main thread.
04-02 07:40:39.585: D/AndroidRuntime(1272): Shutting down VM
04-02 07:40:39.593: W/dalvikvm(1272): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
04-02 07:40:39.694: E/AndroidRuntime(1272): FATAL EXCEPTION: main
04-02 07:40:39.694: E/AndroidRuntime(1272): java.lang.IllegalStateException: Could not execute method of the activity
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.view.View$1.onClick(View.java:3599)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.view.View.performClick(View.java:4204)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.view.View$PerformClick.run(View.java:17355)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.os.Handler.handleCallback(Handler.java:725)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.os.Handler.dispatchMessage(Handler.java:92)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.os.Looper.loop(Looper.java:137)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.app.ActivityThread.main(ActivityThread.java:5041)
04-02 07:40:39.694: E/AndroidRuntime(1272): at java.lang.reflect.Method.invokeNative(Native Method)
04-02 07:40:39.694: E/AndroidRuntime(1272): at java.lang.reflect.Method.invoke(Method.java:511)
04-02 07:40:39.694: E/AndroidRuntime(1272): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-02 07:40:39.694: E/AndroidRuntime(1272): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-02 07:40:39.694: E/AndroidRuntime(1272): at dalvik.system.NativeStart.main(Native Method)
04-02 07:40:39.694: E/AndroidRuntime(1272): Caused by: java.lang.reflect.InvocationTargetException
04-02 07:40:39.694: E/AndroidRuntime(1272): at java.lang.reflect.Method.invokeNative(Native Method)
04-02 07:40:39.694: E/AndroidRuntime(1272): at java.lang.reflect.Method.invoke(Method.java:511)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.view.View$1.onClick(View.java:3594)
04-02 07:40:39.694: E/AndroidRuntime(1272): ... 11 more
04-02 07:40:39.694: E/AndroidRuntime(1272): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.christianalvarez.justriddles/com.christianalvarez.justriddles.Level1}; have you declared this activity in your AndroidManifest.xml?
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1618)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1417)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.app.Activity.startActivityForResult(Activity.java:3370)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.app.Activity.startActivityForResult(Activity.java:3331)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.app.Activity.startActivity(Activity.java:3566)
04-02 07:40:39.694: E/AndroidRuntime(1272): at android.app.Activity.startActivity(Activity.java:3534)
04-02 07:40:39.694: E/AndroidRuntime(1272): at com.christianalvarez.justriddles.GameMenuActivity.onClickLevel1(GameMenuActivity.java:19)
04-02 07:40:39.694: E/AndroidRuntime(1272): ... 14 more
04-02 07:40:43.493: I/Process(1272): Sending signal. PID: 1272 SIG: 9
的logcat的是相當自明。您尚未在您的Manifest文件中聲明活動「Level1」:引發:android.content.ActivityNotFoundException:無法找到顯式活動類{com.christianalvarez.justriddles/com.christianalvarez.justriddles.Level1};你有沒有在你的AndroidManifest.xml中聲明這個活動?' – 2013-05-01 06:45:16
粘貼你的代碼。你如何傳遞意圖? – 2013-05-01 06:45:20
首先你搜索這個錯誤:android.content.ActivityNotFoundException然後在這裏問問題後.. – SBJ 2013-05-01 06:51:35