How to implement multi-threading in Android using AsyncTask

preview_player
Показать описание
In this video we learn how to offload long-running tasks off of Android's main UI thread using the AsyncTask.

We learn how to implement the following methods in order to establish communication between a worker thread and the UI thread.

doInBackground - code here is executed on a background thread

onPreExecute - this code runs before the doInBackground runs

onPostExecute - this code runs once the background thread is completed

publishProgress onProgressUpdate are used to communicate between the UI and background threads.
Рекомендации по теме
Комментарии
Автор

Amazingly explained! You got a new subscriber :)

HaudreN
Автор

good video. would have been nice to have a link to the code so we could look around

ryannichols
Автор

Sorry, may I ask where is the button instance in the code?
I can't see the button code, so how did you do the clicking button action?

king
Автор

im using async task in two pages but the second page loses the json data... can you please explain how to call async task for two different tasks. thank you

IamPali
welcome to shbcf.ru