2013-05-01 73 views
-6

我有一個主菜單的圖片說播放,導致水平選擇菜單。一旦你通過主菜單並繼續選擇一個級別,它會崩潰並給出這個錯誤。我的意圖與我在主菜單中完全一樣。任何一個能夠幫助我弄清楚爲什麼這會一直崩潰?我的應用程序崩潰,只要我啓動一個意圖開始一個新的活動

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 
+3

的logcat的是相當自明。您尚未在您的Manifest文件中聲明活動「Level1」:引發:android.content.ActivityNotFoundException:無法找到顯式活動類{com.christianalvarez.justriddles/com.christianalvarez.justriddles.Level1};你有沒有在你的AndroidManifest.xml中聲明這個活動?' – 2013-05-01 06:45:16

+0

粘貼你的代碼。你如何傳遞意圖? – 2013-05-01 06:45:20

+0

首先你搜索這個錯誤:android.content.ActivityNotFoundException然後在這裏問問題後.. – SBJ 2013-05-01 06:51:35

回答

-1

看起來你似乎還沒有在Android清單文件中爲此活動添加活動標籤。您需要爲androidmanifest文件中的每個活動添加一個活動標記。

0

從您的logcat錯誤中可以清楚地看出您錯過了AndroidManifest文件中的活動聲明。

請您清單文件中聲明你的活動如下:

<application 
    android:label="@string/app_name" 

    <activity 
     android:name="com.christianalvarez.justriddles.Level1" 
     android:label="@string/app_name" > 
     </application> 
+0

謝謝。我完全忘記了這一點。即時消息仍然公平地對所有這 – user2235166 2013-05-01 06:59:04

+0

如果它已經解決了您的問題,請標記答案的權利。謝謝 :) – GrIsHu 2013-05-01 07:03:50

相關問題