我被一個ConcurrentModificationException
卡住了,我無法弄清楚在我的代碼中發生了什麼。所有這一切調試給我是這樣的:當你正在修改的集合而遍歷它發生如何找出ConcurrentModificationException崩潰的位置?
myApp [Android Application]
DalvikVM[localhost:8631]
Thread [<1> main] (Suspended (exception ConcurrentModificationException))
ViewRoot.draw(boolean) line: 1631
ViewRoot.performTraversals() line: 1329
ViewRoot.handleMessage(Message) line: 1944
ViewRoot(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 126
ActivityThread.main(String[]) line: 3997
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 491
ZygoteInit$MethodAndArgsCaller.run() line: 841
ZygoteInit.main(String[]) line: 599
NativeStart.main(String[]) line: not available [native method]
Thread [<8> Binder Thread #2] (Running)
Thread [<7> Binder Thread #1] (Running)
Thread [<9> AsyncTask #1] (Running)
Thread [<10> AsyncTask #2] (Running)
Daemon Thread [<12> [email protected]@40770068] (Running)
Thread [<11> AsyncTask #3] (Running)
您應該在logcat中獲得完整的堆棧跟蹤。在eclipse中使用'Window - > Show View - > Logcat'或從SDK文件夾啓動'ddms'應用程序。崩潰後應該有一個帶有標記* AndroidRuntime *的大紅色塊。 – 2011-12-24 12:26:27
Logcat顯示的唯一東西是isDEBUG/AndroidRuntime(899):>>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<沒有大分塊... – michaelsmith
哦,對不起,忘了說明了,在您錯過了這種情況:當您處於調試模式時,您必須恢復執行,並且調試器停止在異常處。當您看到「強制關閉」對話框時,會打印日誌語句。 – 2011-12-24 13:30:41