当我尝试从arraylist外部更新我的arraylist时,我的logcat显示addAll行抛出了并发修改异常。
if(table!=null&&players!=null) {
List l = null;
for(int i = 0;i<players.size();i++) {
if(players.get(i).getId().equals(MainActivity.myDetails.getId())&&i!=0) {
players.addAll(players.subList(0,i));
l = players.subList(i,players.size());
}
}
players.clear();
players.addAll(l);
}