我用登录制作了一个Android应用程序,它运行了大约5-6次,然后我在模拟器上尝试了大量的错误强制关闭,但似乎没有任何工作。也许有人可以帮助解决日志cat错误。
04-26 15:39:41.451: D/AndroidRuntime(286): Shutting down VM
04-26 15:39:41.451: W/dalvikvm(286): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
04-26 15:39:41.479: E/AndroidRuntime(286): FATAL EXCEPTION: main
04-26 15:39:41.479: E/AndroidRuntime(286): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.androidhive/com.example.androidhive.DashboardActivity}: java.lang.NullPointerException
04-26 15:39:41.479: E/AndroidRuntime(286): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
04-26 15:39:41.479: E/AndroidRuntime(286): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-26 15:39:41.479: E/AndroidRuntime(286): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-26 15:39:41.479: E/AndroidRuntime(286): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-26 15:39:41.479: E/AndroidRuntime(286): at android.os.Handler.dispatchMessage(Handler.java:99)
04-26 15:39:41.479: E/AndroidRuntime(286): at android.os.Looper.loop(Looper.java:123)
04-26 15:39:41.479: E/AndroidRuntime(286): at android.app.ActivityThread.main(ActivityThread.java:4627)
04-26 15:39:41.479: E/AndroidRuntime(286): at java.lang.reflect.Method.invokeNative(Native Method)
04-26 15:39:41.479: E/AndroidRuntime(286): at java.lang.reflect.Method.invoke(Method.java:521)
04-26 15:39:41.479: E/AndroidRuntime(286): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-26 15:39:41.479: E/AndroidRuntime(286): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-26 15:39:41.479: E/AndroidRuntime(286): at dalvik.system.NativeStart.main(Native Method)
04-26 15:39:41.479: E/AndroidRuntime(286): Caused by: java.lang.NullPointerException
04-26 15:39:41.479: E/AndroidRuntime(286): at com.example.androidhive.DashboardActivity.onCreate(DashboardActivity.java:55)
04-26 15:39:41.479: E/AndroidRuntime(286): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-26 15:39:41.479: E/AndroidRuntime(286): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
这是仪表板活动代码