我正在运行一段在eclipse中抛出错误的代码。奇怪的是,logcat显示在抛出错误后程序继续运行,此外代码块正确执行它的任务,我无法捕获错误。这可能是一个日食错误吗?我在下面包含了我的logcat。
10-26 22:38:13.300: INFO/System.out(844): Proxy Main Triggered URL: http://api.discogs.com/master/39614
10-26 22:38:13.300: INFO/System.out(844): 1Proxy Main Triggered
10-26 22:38:13.300: INFO/System.out(844): 2Proxy Main Triggered
10-26 22:38:13.310: INFO/System.out(844): 3Proxy Main Triggered
10-26 22:38:13.310: INFO/System.out(844): 4Proxy Main Triggered
10-26 22:38:13.310: INFO/System.out(844): 5Proxy Main Triggered
10-26 22:38:13.320: DEBUG/AndroidRuntime(844): Shutting down VM
10-26 22:38:13.320: WARN/dalvikvm(844): threadid=3: thread exiting with uncaught exception (group=0x4001da28)
10-26 22:38:13.320: ERROR/AndroidRuntime(844): Uncaught handler: thread main exiting due to uncaught exception
10-26 22:38:13.330: ERROR/AndroidRuntime(844): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.discog10/com.discog10.popUpActivity}: java.lang.NullPointerException
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at android.app.ActivityThread.access$2100(ActivityThread.java:116)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at android.os.Handler.dispatchMessage(Handler.java:99)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at android.os.Looper.loop(Looper.java:123)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at android.app.ActivityThread.main(ActivityThread.java:4203)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at java.lang.reflect.Method.invokeNative(Native Method)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at java.lang.reflect.Method.invoke(Method.java:521)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at dalvik.system.NativeStart.main(Native Method)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): Caused by: java.lang.NullPointerException
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at com.discog10.popUpActivity.onCreate(popUpActivity.java:82)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
10-26 22:38:13.330: ERROR/AndroidRuntime(844): ... 11 more
10-26 22:38:13.340: INFO/Process(90): Sending signal. PID: 844 SIG: 3
10-26 22:38:13.350: INFO/dalvikvm(844): threadid=7: reacting to signal 3
10-26 22:38:13.350: ERROR/dalvikvm(844): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
10-26 22:38:13.640: INFO/System.out(844): 6Proxy Main Triggered
10-26 22:38:13.650: INFO/global(844): Default buffer size used in BufferedReader constructor. It would be better to be explicit if an 8k-char buffer is required.
10-26 22:38:13.650: INFO/System.out(844): 7Proxy Main Triggered
10-26 22:38:13.650: INFO/System.out(844): Proxy Main Complete
答案 0 :(得分:1)
尝试修复导致此行出现NullPointerException的代码(或将其作为问题的一部分发布):
com.discog10.popUpActivity.onCreate(popUpActivity.java:82)
你运行几个线程吗?恕我直言,这不太可能是Eclipse中的一个错误。