I'm was facing the same problem with exactly the same error log.
In my case onProgress()
of the AsyncTask adds the values to the adapter using mAdapter.add(newEntry)
. To avoid the UI becoming less responsive I set mAdapter.setNotifyOnChange(false)
and call mAdapter.notifyDataSetChanged()
4 times the second. Once per second the array is sorted.
This work well and looks very addictive, but unfortunately it is possible to crash it by touching the shown list items often enough.
But it seems I have found an acceptable workaround.
My guess it that even if you just work on the ui thread the adapter does not accept many changes to it's data without calling notifyDataSetChanged()
, because of this I created a queue that is storing all the new items until the mentioned 300ms are over. If this moment is reached I add all the stored items in one shot and call notifyDataSetChanged()
.
Until now I was not able to crash the list anymore.