It will be great if someone here will know how to help me with the issue bellow.
What is the best way to display a database queries results on the screen using ListActivity? I need the db queries to run in the background and I also need to be able to make different queries and refresh the screen according to the query result.
I am using the ListActivity class with a SimpleCursorAdapter in order to display the db queries result on the screen.
At the moment, I am doing the db queries at the background using AsyncTask, when getting the results I want the list to be updated immediately, but I can't find a good way to do it.
It worked only when I used the changeCursor(cursor) function to set the adapter to a new cursor with the new results. But I don't think this is a good solution since it seems to stuck the UI for a while.
I also found some posts about notifyDataSetChanged() but I am not sure if/how/when I should be using it with a SimpleCursorAdapter to make the view refresh.
Can anyone tell what I am doing wrong? Or give a code example or link to something like this that works?