Update the UI outside the main thread

后端 未结 5 1186
梦谈多话
梦谈多话 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:50

    you have to use an Handler instance and use the post method do add a Runnable inside the queue of the UI Thread. If you are inside an Activity you can use runOnUiThread that is a "shortcut" to do the same thing

提交回复
热议问题