我被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)
答案 0 :(得分:0)
ConcurrentModificationException
。此时,您可能更容易搜索正在更改集合的foreach循环。