请帮我解决这个问题,一旦我进入相机活动,我就无法恢复我的活动。- 我的相机活动中有一个按钮可以转到下一个活动,即我的OpenurlActivity
. 但是当我点击后退按钮时,我的 logcat 上出现了这个错误:
08-15 17:49:55.518: E/AndroidRuntime(13628): FATAL EXCEPTION: main
08-15 17:49:55.518: E/AndroidRuntime(13628): java.lang.RuntimeException: Unable to
resume activity {com.example.qrreader/com.example.qrreader.CameraTestActivity}:
java.lang.NullPointerException
08-15 17:49:55.518: E/AndroidRuntime(13628): at
android.app.ActivityThread.performResumeActivity(ActivityThread.java:2825)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2854)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
android.os.Handler.dispatchMessage(Handler.java:99)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
android.os.Looper.loop(Looper.java:137)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
android.app.ActivityThread.main(ActivityThread.java:5293)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
java.lang.reflect.Method.invokeNative(Native Method)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
java.lang.reflect.Method.invoke(Method.java:511)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
dalvik.system.NativeStart.main(Native Method)
08-15 17:49:55.518: E/AndroidRuntime(13628): Caused by: java.lang.NullPointerException
08-15 17:49:55.518: E/AndroidRuntime(13628): at
com.example.qrreader.CameraTestActivity.onResume(CameraTestActivity.java:510)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1202)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
android.app.Activity.performResume(Activity.java:5328)
08-15 17:49:55.518: E/AndroidRuntime(13628): at
android.app.ActivityThread.performResumeActivity(ActivityThread.java:2815)
08-15 17:49:55.518: E/AndroidRuntime(13628): ... 10 more
为什么会出现这个错误?