我遇到了 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> RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@40770068] (Running)
Thread [<11> AsyncTask #3] (Running)
最佳答案
ConcurrentModificationException
当您在迭代集合时修改集合时会发生。此时,仅搜索要更改集合的 foreach 循环可能会更容易。
关于java - 如何找出这个ConcurrentModificationException崩溃的地方?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8624430/