my app crash when i try to remove object from array list :
for (ColouredPaths p : mTouches) {
if(erase){
if(p!=null)
{ mTouches.remove(p);}
}
why this is happening and how o fix ?
my app crash when i try to remove object from array list :
for (ColouredPaths p : mTouches) {
if(erase){
if(p!=null)
{ mTouches.remove(p);}
}
why this is happening and how o fix ?
Copyright © 2021 Jogjafile Inc.
If you're getting a
ConcurrentException, it means you're looping through a list that you're modifying. In ArrayLists, you can't do this. Try using aQueuelike this, instead of anArrayList:You can loop through it the same way, but it shouldn't crash anymore.