问题描述
06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:FATALEXCEPTION:main06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:java.lang.RuntimeException:UnabletostartactivityComponentInfo{exampleintent.com.myfinaltest/exampleintent.com.myfinaltest.MainActivity}:java.lang.NullPointerException06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2416)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.ActivityThread.access$600(ActivityThread.java:175)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.ActivityThread$H.handleMessage(ActivityThread.java:1386)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.os.Handler.dispatchMessage(Handler.java:107)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.os.Looper.loop(Looper.java:194)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.ActivityThread.main(ActivityThread.java:5434)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atjava.lang.reflect.Method.invokeNative(NativeMethod)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atjava.lang.reflect.Method.invoke(Method.java:525)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atcom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:838)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atdalvik.system.NativeStart.main(NativeMethod)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:Causedby:java.lang.NullPointerException06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atexampleintent.com.myfinaltest.MainActivity.onCreate(MainActivity.java:34)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.Activity.performCreate(Activity.java:5273)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1153)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2328)06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2416) 06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.ActivityThread.access$600(ActivityThread.java:175) 06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.ActivityThread$H.handleMessage(ActivityThread.java:1386) 06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.os.Handler.dispatchMessage(Handler.java:107) 06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.os.Looper.loop(Looper.java:194) 06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atandroid.app.ActivityThread.main(ActivityThread.java:5434) 06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atjava.lang.reflect.Method.invokeNative(NativeMethod) 06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atjava.lang.reflect.Method.invoke(Method.java:525) 06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atcom.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:838) 06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atcom.android.internal.os.ZygoteInit.main(ZygoteInit.java:605) 06-2820:30:42.19315483-15483/exampleintent.com.myfinaltestE/AndroidRuntime:atdalvik.system.NativeStart.main(NativeMethod) 这是LOGCAT来大神帮我看下。
解决方案
解决方案二:
什么时候android也和.net搭边了
解决方案三:
引用
MainActivity.java:34
这么明显
解决方案四:
引用2楼shingoscar的回复:
引用
MainActivity.java:34这么明显
什么意思???
解决方案五:
引用3楼qq_20156659的回复:
Quote: 引用2楼shingoscar的回复:
引用
MainActivity.java:34这么明显
什么意思???
这你都不理解吗???我只好建议,先以java、堆栈、调试等关键词搜索并学习下