Call notifyDataSetChanged after each item I receive in AsyncTask

Viewed 554

I use an AsyncTask and on doInBackground() I have a loop where I'm doing a lot of network calls. Each call gives me a new data object that I want to add it to my listView.

I know that I can call notifyDataSetChanged() on onPostExecute() and update my list with all my items but I'm wondering if its possible to somehow call notifyDataSetChanged() when I receive a new item and update my listView the same moment and not to have to wait until all the work on doInBackground finishes.

If there isn't a way I can do this with AsyncTask then whats the proper way to deal with something like that?

Thank you

1 Answers
Related