并发修改异常:向ArrayList添加
Element element = it.next();
OnTouchEvent
for (Iterator<Element> it = mElements.iterator(); it.hasNext();){ Element element = it.next(); if(touchX > element.mX && touchX < element.mX + element.mBitmap.getWidth() && touchY > element.mY && touchY < element.mY + element.mBitmap.getHeight()) { //irrelevant stuff.. if(element.cFlag){ mElements.add(new Element("crack",getResources(), (int)touchX,(int)touchY)); element.cFlag = false; } } }
synchronized(mElements)
mElements
ArrayList<Element>
Element
cFlag
Element
crack
Element
Elements
Element
cFlag
Element
缥缈止盈
慕运维8079593
料青山看我应如是
相关分类