2011-06-23 47 views
0

我的應用程序在我實現onDestroy()功能之前僅僅工作了幾分鐘。它沒有工作,所以我擺脫它只發現我的應用程序不會超過啓動畫面。有人可以幫忙嗎?登錄貓以下謝謝。應用程序工作之前,現在不是。日誌貓

06-23 13:24:55.486: INFO/ActivityManager(164): Start proc com.example.sdr for activity com.example.sdr/.SplashMain: pid=8700 uid=10063 gids={3003} 
06-23 13:24:55.786: DEBUG/dalvikvm(8700): GC_EXTERNAL_ALLOC freed 663 objects/51760 bytes in 100ms 
06-23 13:24:56.236: INFO/ActivityManager(164): Displayed activity com.example.sdr/.SplashMain: 770 ms (total 242823 ms) 
06-23 13:25:01.106: INFO/ActivityManager(164): Starting activity: Intent { act=com.example.sdr.CLEARSCREEN cmp=com.example.sdr/.MainTab } 
06-23 13:25:01.216: DEBUG/AndroidRuntime(8700): Shutting down VM 
06-23 13:25:01.226: WARN/dalvikvm(8700): threadid=1: thread exiting with uncaught exception (group=0x400207e8) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700): FATAL EXCEPTION: main 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sdr/com.example.sdr.MainTab}: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.sdr/com.example.sdr.PlaylistActivity}: java.lang.NullPointerException 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.ActivityThread.access$2300(ActivityThread.java:125) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.os.Handler.dispatchMessage(Handler.java:99) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.os.Looper.loop(Looper.java:123) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.ActivityThread.main(ActivityThread.java:4627) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at java.lang.reflect.Method.invokeNative(Native Method) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at java.lang.reflect.Method.invoke(Method.java:521) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at dalvik.system.NativeStart.main(Native Method) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700): Caused by: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.sdr/com.example.sdr.PlaylistActivity}: java.lang.NullPointerException 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.ActivityThread.startActivityNow(ActivityThread.java:2503) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:676) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.widget.TabHost.setCurrentTab(TabHost.java:348) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.widget.TabHost.addTab(TabHost.java:227) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at com.example.sdr.MainTab.onCreate(MainTab.java:27) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  ... 11 more 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700): Caused by: java.lang.NullPointerException 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.Activity.findViewById(Activity.java:1637) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at com.example.sdr.PlaylistActivity.<init>(PlaylistActivity.java:93) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at java.lang.Class.newInstanceImpl(Native Method) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at java.lang.Class.newInstance(Class.java:1429) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577) 
06-23 13:25:01.286: ERROR/AndroidRuntime(8700):  ... 20 more 

回答

0

您確定您在onCreate中正確設置了嗎? Android無法在第93行的PlaylistActivity.java中找到某些視圖。

+0

是正確定義的。我不知道它會是什麼,因爲我從來沒有搞亂。 – Splitusa

+0

清理您的項目。 – piotrpo

+0

調用'setContentView(R.layout.main);'在用'findViewById()'得到任何視圖之前, – Houcine

相關問題