I am reading a few thousand items out of a database in my Android app and want to show a loading dialog, start a thread and read the database then close the dialog and then populate a listview with the data.
I cant seem to figure this out.
I have the dialog pop up and disappear but I don’t know how to populate the listview after the thread is done.
Any ideas?
Use an AsyncTask, populate the listview in onPostExecute().
http://www.screaming-penguin.com/node/7746
…
Also helpful:
http://developer.android.com/resources/articles/painless-threading.html