The problem occurs at
Element element = it.next();
And this code which contains that line, is inside of an OnTouchEvent
OnTouchEvent
I solved creating a lock (Kotlin):
import java.util.concurrent.locks.ReentrantLock Class A { private val listLock = ReentrantLock() fun doSomething(newElement){ listLock.lock() list.add(newElement) listLock.unlock() } }