I searched and found what looked like the exact question I have (http://stackoverflow.com/questions/4369537/update-ui-from-thread). Unfortunately I'm still not able to get this working.
I have an ImageView on my layout. When a button is pressed, a ProgressDialog is created and shown. As the thread processes data, it calls the incrementProgressBy() method on a handler in the UI. Inside that handler, I update the ImageView using setImageBitmap(), and then I Invalidate it. It never updates. 开发者_开发问答Next, I tried calling ImageView.postInvalidate() from the progress bar's thread. It still does not update until the progress bar completes and is removed.
Any ideas?
The solution here was to use an AsyncTask. It's able to communicate with the UI via handlers.
精彩评论