Advanced AsyncTask and Progress Dialogs
Dave MacLean, Satya Komatineni, Grant Allen · Apress eBooks · 2015
In Chapter 13, we covered handlers and worker threads to run long-running tasks while the main thread kept the UI house in order. Android SDK has recognized this as a pattern and abstracted the handler and thread details into a utility class called AsyncTask . You can use AsyncTask to run tasks that take longer than five seconds in the context of UI. (We will cover how to run really long-running tasks, ranging from minutes to even hours, through “Long-Running Receivers and Services” in Chapter 16.)