My solution:
1) create a temp ArrayList
.
2) do your heavy works (sqlite row fetch , ...) in doInBackground
method and add items to the temp arraylist.
3) add all items from temp araylist to your listview's arraylist in onPostExecute
method.
note:
you may want to delete some items from listview and also delete from sqlite database and maybe delete some files related to items from sdcard , just remove items from database and remove their related files and add them to temp arraylist in background thread
. then in UI thread
delete items existing in temp arraylist from the listview's arraylist.
Hope this helps.