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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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