Android闪退问题

03-19 17:18:28.225 2809-4087/? W/InterceptionReason: reason:6)finally, intercept as usual, interception = false details<<runType:activity isFgAction:true callerPkg:com.example.zhengli.myapplication calleePkg:com.example.zhengli.myapplication processName:com.example.zhengli.myapplication Intent { cmp=com.example.zhengli.myapplication/.MainActivity }>>
03-19 17:18:28.226 2809-4087/? I/ActivityManager: START u0 {cmp=com.example.zhengli.myapplication/.MainActivity} from uid 10162 on display 0
03-19 17:18:28.371 18344-18344/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.zhengli.myapplication, PID: 18344
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zhengli.myapplication/com.example.zhengli.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2774)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6243)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.zhengli.myapplication.MainActivity.onCreate(MainActivity.java:97)
at android.app.Activity.performCreate(Activity.java:6756)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6243) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 
03-19 17:18:28.373 2809-3741/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:18:28.385 2809-3741/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:18:28.389 2809-3741/? E/ActivityManager: Found activity ActivityRecord{87e11c6 u0 com.example.zhengli.myapplication/.MainActivity t12 f} in proc activity list using null instead of expected ProcessRecord{8e4edd9 18344:com.example.zhengli.myapplication/u0a162}
03-19 17:18:30.460 2809-4058/? W/InterceptionReason: reason:6)finally, intercept as usual, interception = false details<<runType:activity isFgAction:true callerPkg:com.example.zhengli.myapplication calleePkg:com.example.zhengli.myapplication processName:com.example.zhengli.myapplication Intent { cmp=com.example.zhengli.myapplication/.MainActivity }>>
03-19 17:18:30.461 2809-4058/? I/ActivityManager: START u0 {cmp=com.example.zhengli.myapplication/.MainActivity} from uid 10162 on display 0
03-19 17:18:30.597 18452-18452/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.zhengli.myapplication, PID: 18452
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zhengli.myapplication/com.example.zhengli.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2774)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6243)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.zhengli.myapplication.MainActivity.onCreate(MainActivity.java:97)
at android.app.Activity.performCreate(Activity.java:6756)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6243) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 
03-19 17:18:30.599 2809-4037/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:18:30.608 2809-4037/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:18:30.611 2809-4037/? E/ActivityManager: Found activity ActivityRecord{16551bd u0 com.example.zhengli.myapplication/.MainActivity t13 f} in proc activity list using null instead of expected ProcessRecord{a4942ac 18452:com.example.zhengli.myapplication/u0a162}
03-19 17:18:32.195 2809-4106/? W/InterceptionReason: reason:6)finally, intercept as usual, interception = false details<<runType:activity isFgAction:true callerPkg:com.example.zhengli.myapplication calleePkg:com.example.zhengli.myapplication processName:com.example.zhengli.myapplication Intent { cmp=com.example.zhengli.myapplication/.MainActivity }>>
03-19 17:18:32.196 2809-4106/? I/ActivityManager: START u0 {cmp=com.example.zhengli.myapplication/.MainActivity} from uid 10162 on display 0
03-19 17:18:32.333 18507-18507/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.zhengli.myapplication, PID: 18507
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zhengli.myapplication/com.example.zhengli.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2774)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6243)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.zhengli.myapplication.MainActivity.onCreate(MainActivity.java:97)
at android.app.Activity.performCreate(Activity.java:6756)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6243) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 
03-19 17:18:32.335 2809-4104/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:18:32.346 2809-4104/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:18:32.349 2809-4104/? E/ActivityManager: Found activity ActivityRecord{6637ce0 u0 com.example.zhengli.myapplication/.MainActivity t14 f} in proc activity list using null instead of expected ProcessRecord{8d3b26a 18507:com.example.zhengli.myapplication/u0a162}
03-19 17:21:20.586 2809-4105/? W/InterceptionReason: reason:6)finally, intercept as usual, interception = false details<<runType:activity isFgAction:true callerPkg:com.example.zhengli.myapplication calleePkg:com.example.zhengli.myapplication processName:com.example.zhengli.myapplication Intent { cmp=com.example.zhengli.myapplication/.MainActivity }>>
03-19 17:21:20.587 2809-4105/? I/ActivityManager: START u0 {cmp=com.example.zhengli.myapplication/.MainActivity} from uid 10162 on display 0
03-19 17:21:20.720 18724-18724/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.zhengli.myapplication, PID: 18724
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zhengli.myapplication/com.example.zhengli.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2774)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6243)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.zhengli.myapplication.MainActivity.onCreate(MainActivity.java:94)
at android.app.Activity.performCreate(Activity.java:6756)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6243) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 
03-19 17:21:20.722 2809-3849/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:21:20.730 2809-3849/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:21:20.732 2809-3849/? E/ActivityManager: Found activity ActivityRecord{2fa6e03 u0 com.example.zhengli.myapplication/.MainActivity t15 f} in proc activity list using null instead of expected ProcessRecord{ad19a7b 18724:com.example.zhengli.myapplication/u0a162}
03-19 17:26:19.259 2809-4104/? W/InterceptionReason: reason:6)finally, intercept as usual, interception = false details<<runType:activity isFgAction:true callerPkg:com.example.zhengli.myapplication calleePkg:com.example.zhengli.myapplication processName:com.example.zhengli.myapplication Intent { cmp=com.example.zhengli.myapplication/.MainActivity }>>
03-19 17:26:19.259 2809-4104/? I/ActivityManager: START u0 {cmp=com.example.zhengli.myapplication/.MainActivity} from uid 10162 on display 0
03-19 17:26:19.393 19066-19066/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.zhengli.myapplication, PID: 19066
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zhengli.myapplication/com.example.zhengli.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2774)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6243)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.zhengli.myapplication.MainActivity.onCreate(MainActivity.java:94)
at android.app.Activity.performCreate(Activity.java:6756)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6243) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 
03-19 17:26:19.396 2809-3126/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:26:19.405 2809-3126/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:26:19.408 2809-3126/? E/ActivityManager: Found activity ActivityRecord{47808ac u0 com.example.zhengli.myapplication/.MainActivity t16 f} in proc activity list using null instead of expected ProcessRecord{a0c144 19066:com.example.zhengli.myapplication/u0a162}
03-19 17:29:05.246 2809-5085/? W/InterceptionReason: reason:6)finally, intercept as usual, interception = false details<<runType:activity isFgAction:true callerPkg:com.example.zhengli.myapplication calleePkg:com.example.zhengli.myapplication processName:com.example.zhengli.myapplication Intent { cmp=com.example.zhengli.myapplication/.MainActivity }>>
03-19 17:29:05.247 2809-5085/? I/ActivityManager: START u0 {cmp=com.example.zhengli.myapplication/.MainActivity} from uid 10162 on display 0
03-19 17:29:05.467 19259-19259/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.zhengli.myapplication, PID: 19259
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zhengli.myapplication/com.example.zhengli.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2774)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6243)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.zhengli.myapplication.MainActivity.onCreate(MainActivity.java:94)
at android.app.Activity.performCreate(Activity.java:6756)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6243) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 
03-19 17:29:05.468 2809-4992/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:29:05.477 2809-4992/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:29:05.479 2809-4992/? E/ActivityManager: Found activity ActivityRecord{cfb9caa u0 com.example.zhengli.myapplication/.MainActivity t17 f} in proc activity list using null instead of expected ProcessRecord{bc71702 19259:com.example.zhengli.myapplication/u0a162}
03-19 17:30:55.737 2809-4992/? W/InterceptionReason: reason:6)finally, intercept as usual, interception = false details<<runType:activity isFgAction:true callerPkg:com.example.zhengli.myapplication calleePkg:com.example.zhengli.myapplication processName:com.example.zhengli.myapplication Intent { cmp=com.example.zhengli.myapplication/.MainActivity }>>
03-19 17:30:55.737 2809-4992/? I/ActivityManager: START u0 {cmp=com.example.zhengli.myapplication/.MainActivity} from uid 10162 on display 0
03-19 17:30:55.893 19440-19440/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.zhengli.myapplication, PID: 19440
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zhengli.myapplication/com.example.zhengli.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2774)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6243)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.zhengli.myapplication.MainActivity.onCreate(MainActivity.java:94)
at android.app.Activity.performCreate(Activity.java:6756)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6243) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 
03-19 17:30:55.894 2809-5083/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:30:55.904 2809-5083/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:30:55.906 2809-5083/? E/ActivityManager: Found activity ActivityRecord{f54a343 u0 com.example.zhengli.myapplication/.MainActivity t18 f} in proc activity list using null instead of expected ProcessRecord{f1537bb 19440:com.example.zhengli.myapplication/u0a162}
03-19 17:33:02.854 2809-3741/? W/InterceptionReason: reason:6)finally, intercept as usual, interception = false details<<runType:activity isFgAction:true callerPkg:com.example.zhengli.myapplication calleePkg:com.example.zhengli.myapplication processName:com.example.zhengli.myapplication Intent { cmp=com.example.zhengli.myapplication/.MainActivity }>>
03-19 17:33:02.854 2809-3741/? I/ActivityManager: START u0 {cmp=com.example.zhengli.myapplication/.MainActivity} from uid 10162 on display 0
03-19 17:33:02.994 19591-19591/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.zhengli.myapplication, PID: 19591
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zhengli.myapplication/com.example.zhengli.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2774)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6243)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.zhengli.myapplication.MainActivity.onCreate(MainActivity.java:94)
at android.app.Activity.performCreate(Activity.java:6756)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6243) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 
03-19 17:33:02.995 2809-3849/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:33:03.004 2809-3849/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:33:03.005 2809-3849/? E/ActivityManager: Found activity ActivityRecord{f8174d u0 com.example.zhengli.myapplication/.MainActivity t19 f} in proc activity list using null instead of expected ProcessRecord{9dde305 19591:com.example.zhengli.myapplication/u0a162}
03-19 17:34:03.287 2809-3599/? W/InterceptionReason: reason:6)finally, intercept as usual, interception = false details<<runType:activity isFgAction:true callerPkg:com.example.zhengli.myapplication calleePkg:com.example.zhengli.myapplication processName:com.example.zhengli.myapplication Intent { cmp=com.example.zhengli.myapplication/.MainActivity }>>
03-19 17:34:03.287 2809-3599/? I/ActivityManager: START u0 {cmp=com.example.zhengli.myapplication/.MainActivity} from uid 10162 on display 0
03-19 17:34:03.435 19706-19706/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.zhengli.myapplication, PID: 19706
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zhengli.myapplication/com.example.zhengli.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2774)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6243)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.zhengli.myapplication.MainActivity.onCreate(MainActivity.java:94)
at android.app.Activity.performCreate(Activity.java:6756)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6243) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 
03-19 17:34:03.437 2809-3741/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:34:03.442 2809-3741/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:34:03.445 2809-3741/? E/ActivityManager: Found activity ActivityRecord{49d47e5 u0 com.example.zhengli.myapplication/.MainActivity t20 f} in proc activity list using null instead of expected ProcessRecord{d780974 19706:com.example.zhengli.myapplication/u0a162}
03-19 17:35:13.929 2809-4105/? W/InterceptionReason: reason:6)finally, intercept as usual, interception = false details<<runType:activity isFgAction:true callerPkg:com.example.zhengli.myapplication calleePkg:com.example.zhengli.myapplication processName:com.example.zhengli.myapplication Intent { cmp=com.example.zhengli.myapplication/.MainActivity }>>
03-19 17:35:13.929 2809-4105/? I/ActivityManager: START u0 {cmp=com.example.zhengli.myapplication/.MainActivity} from uid 10162 on display 0
03-19 17:35:14.066 19875-19875/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.zhengli.myapplication, PID: 19875
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.zhengli.myapplication/com.example.zhengli.myapplication.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2774)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6243)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.zhengli.myapplication.MainActivity.onCreate(MainActivity.java:95)
at android.app.Activity.performCreate(Activity.java:6756)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2835) 
at android.app.ActivityThread.-wrap12(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1560) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:154) 
at android.app.ActivityThread.main(ActivityThread.java:6243) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 
03-19 17:35:14.069 2809-5085/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:35:14.079 2809-5085/? W/ActivityManager: Force finishing activity com.example.zhengli.myapplication/.MainActivity
03-19 17:35:14.081 2809-5085/? E/ActivityManager: Found activity ActivityRecord{e980d02 u0 com.example.zhengli.myapplication/.MainActivity t21 f} in proc activity list using null instead of expected ProcessRecord{7ca748b 19875:com.example.zhengli.myapplication/u0a162}
2018-03-19 17:42 添加评论 分享
已邀请:

最佳回复

2

rosefox - 不会维护的前端后端开发者不是好的android程序员

赞同来自: ask 404275689

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.zhengli.myapplication.MainActivity.onCreate(MainActivity.java:95)

看这行 告诉你 在MainActivity.java第95行 对TextView的setText 设置了空CharSequence对象
1

以风 - 一个喜欢小动物,兴高采烈的android程序员

赞同来自: ask

空指针不都告诉你了吗

要回复问题请先登录注册

退出全屏模式 全屏模式 回复