Update the UI outside the main thread

后端 未结 5 1188
梦谈多话
梦谈多话 2021-01-17 01:21

I am totaly new to android and just want to know if it is any working and possible way to update the UI outside the main thread. Just from my code I have listed below I know

5条回答
  •  既然无缘
    2021-01-17 01:53

    Only main thread can update UI. If your thread want to update UI, use activity.runOnUiThread()

    However your action is just queued to run in UI thread(if you are running it not from UI thread), which mean it can update UI a little bit later.

    http://developer.android.com/reference/android/app/Activity.html#runOnUiThread(java.lang.Runnable)

提交回复
热议问题