Deleting crime after scrolling with ViewPager is not immediately reflected on the CrimeListFragment

  1. Someone talked about it in next Chapter. Deleting Crime deletes the Crime from the DB but throws IndexOutOfBoundsException

  2. For this case, it works for me to change mCrimes = new ArrayList<>(); to mCrimes = new CopyOnWriteArrayList<>(); in CrimeLab.java.

How can I got it? Just basing on the output of the Logcat: java.util.ConcurrentModificationException,
I searched remove Fragment Page from ViewPager in Android java.util.ConcurrentModificationException, and find https://stackoverflow.com/questions/6621991/how-to-handle-concurrentmodificationexception-in-android