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?
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?
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.