草庐IT

mGroupItemSampleList

全部标签

java - 为什么即使同步了列表也会出现ConcurrentModificationException?

我有Android多线程应用程序。两个或多个触发器可能会运行同一部分代码。我有一个对象列表。我让它被Collections.synchronizedList同步privateListmGroupItemSampleList;mGroupItemSampleList=newArrayList();mGroupItemSampleList=Collections.synchronizedList(mGroupItemSampleList);但是有时我在线上遇到异常:Collections.sort(mGroupItemSampleList,newGroupItemSampleCompara