@
Override
protected Boolean doInBackground(final String...params) {
runOnUiThread(new Runnable() {
public void run() {
The problem is when AysncTask executed and onPostExecute() get called (where mAllResultsAdapter.notifyDataSetChanged()
; get called), the Adapter has not bound to ListView yet
. I get the below exception.
java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. [in ListView(2131034153, class android.widget.ListView) with Adapter(class com....tracebuzz.allresults.AllResultsAdapter)]
the problem is the ArrayList
that bound to my Adapter
is changed in the Background thread.
The content of the adapter has changed but ListView did not receive a notification - With AsyncTask
The above problem is my exact situation, but i am just not sure how to apply in my case where there are such 10 ArrayList
getting modified in Back Ground Thread and 10 Adapaters
which needs to be notified.