tags:

views:

104

answers:

1

I have a separate thread running to get data from the internet. After that, I would like to update the ListView in the main thread by calling adapter.notifyDataSetChanged(). But it does not work. Any workaround for that? Thanks.

+3  A: 

Use AsyncTask ( http://developer.android.com/reference/android/os/AsyncTask.html ).

Invoke adapter.notifyDataSetChanged() in onPostExecute(...) method.

For more details, please read this: http://android-developers.blogspot.com/2009/05/painless-threading.html

Damian Kołakowski