Alex Rivera | Logout

How to use setProgressDrawable() correctly?

Asked 2010-02-17T13:09:01.153
13

I am having problem with setting a new Drawable to my ProgressBar.

If I use the setProgressDrawable() inside onCreate() method it works great. But when I try to call the same method inside a Handler post callback it doesn't work and the progressbar disapears.

Can someone explain this behaviour? How can I solve this problem?

Edit
Report

1 Answer

0

Maybe you put the code in a thread which is not main thread. If you want to work with the UI, you must do that in the main thread :)

answered 2010-02-17T17:20:20.173

Your Answer