0

I have an async task which runs in a separate Thread of my Service.

I'd like to get the result of this task back into the main UI thread and wake up the main UI thread to deal with it.

What's the best way of doing this?

HitOdessit
  • 7,198
  • 4
  • 36
  • 59
fadedbee
  • 42,671
  • 44
  • 178
  • 308

1 Answers1

2

The correct way of doing this with an AsyncTask is to return the result back to the UI thread in the onPostExecute method.

There are tons of examples of AsyncTask implementations on Stack Overflow so I'm not going to link to any of them. If you would like an example specifically tailored to your AsyncTask, include the relevant code in your question.

Marvin Pinto
  • 30,138
  • 7
  • 37
  • 54