In my android application, I want to strictly follow the Android guidelines. So after executing the AsyncTask
, I have 2 options to update the UI with the results.
- I can either send the results back the main thread using a call-back listener and update the UI from there.
- I can also pass a reference of the desired UI elements to
AsyncTask
and update these elements inonPostExecute
.
So, which approach is better and why?