Slide 25
Slide 25 text
GET OFF THE UI THREAD - ASYNCTASK
➤ Yes, there are better ways (Kotlin Coroutines, RX Java, Threadpool executor, …)
➤ But for getting started check out AsyncTask
➤ Set up
➤ onPreExecute()
➤ Do this work in the background
➤ doInBackground(arguments)
➤ Here’s the result on the main thread for you
➤ onPostExecute(result)
@scottyab
https://developer.android.com/reference/android/os/AsyncTask