Only the original thread that created a view hierarchy can touch its views ERROR

后端 未结 2 1636
孤城傲影
孤城傲影 2021-01-29 10:54

Everything works except when it reaches till the last part of the code with \"Successfully Registered!\" then the error as mentioned in the title appears inside the registerDial

相关标签:
2条回答
  • 2021-01-29 11:27

    You do some UI work in your doInBackground, for example this call

    rAuth.setTextColor(Color.GREEN);
    

    Move this code to the onPostExecute method.

    0 讨论(0)
  • 2021-01-29 11:43

    I'm guessing that rAuth is a TextView. This needs to be moved to the onPostExecute() as you can't update UI elements in the doInBackground(). Only the onPostExecute(), onProgressUpdate() and onPreExecute() run on the UI thread.

    Here is Link to Docs

    0 讨论(0)
提交回复
热议问题