Android - using runOnUiThread to do UI changes from a thread

后端 未结 5 1230
走了就别回头了
走了就别回头了 2020-12-06 04:18

I am using a custom title view and would like to show/hide a progressbar in the title view when a thread is working.

This is my title view\'s XML

<         


        
5条回答
  •  难免孤独
    2020-12-06 05:12

    What you should use in this case is AsyncTask, see http://developer.android.com/reference/android/os/AsyncTask.html

    If you're not targeting a pre-1.5 version of Android, you will have to use a different class called UserTask. See http://android-developers.blogspot.com/2009/05/painless-threading.html

提交回复
热议问题