how to add runOnUiThread() in my Activity

后端 未结 2 497
执笔经年
执笔经年 2021-01-28 11:07

I added the AsyncTask to offload network operations to a background thread.I need to make sure the UI operations are on the UI thread.So i want to Use runOnUiThread() in my Acti

2条回答
  •  迷失自我
    2021-01-28 11:28

    You should not be accessing any UI elements within doInBackground, This method runs in background thread. What you should do is override onPostExecute() method and access your TextView there. onPostExecute runs in UI thread, so you don't need to call runOnUiThread()

提交回复
热议问题