It looks like the comments that your ArrayList<Collectable> receives from the onDraw() method in one thread, by the user interface at the same time as deleting elements from it in another thread.
So why not just wrap both accessors in
synchronized(array_list_name) {
Please note that this can lead to a delay in the user interface if deleting items takes a long time. If so, consider making a list of all the indexes of the items you want to remove, and delete them in a narrow, synchronized loop after iterating through the entire list.
Update
It seems to me that your whole piece of code can be simplified:
synchronized(array_list_name) return array_list_name.remove(id);
source share