Pages

Sunday, 28 May 2017

AsyncTasks


AsyncTasks

  • This class allows you to perform background operations and publish results on the UI thread without having to manipulate threads and/or handlers.

  • The task can be executed only once (an exception will be thrown if a second execution is attempted.)
  • The doInBackground() will continue execution even if the calling activity is destroyed, make sure to call cancel(true) in the activity’s onDestroy(). The task onCancelled() will be called instead of onPostExecute() right after doInBackground() returns
  • Illustration of the basic operations that will be overridden are shown in the following diagram


Reference: https://developer.android.com/reference/android/os/AsyncTask.html


Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License

No comments:

Post a Comment