在我实施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 :(得分:0)
您确定要在setContentView(your_layout_xml)
中正确设置onCreate
吗? Android无法在第93行PlaylistActivity.java
找到一些视图。