官术网_书友最值得收藏!

Chapter 3. Exploring the AsyncTask

In Chapter 2, Performing Work with Looper, Handler and HandlerThread, we familiarized ourselves with the most basic asynchronous and concurrency constructs available on the Android platform: Handler and Looper. Those constructs underpin most of the evented and sequential processing used by the main thread to render the UI and to run the Android components life cycle.

In this chapter, we are going to explore android.os.AsyncTask, a higher level construct that provides us with a neat and lean interface to perform background work and publish results back to the main thread without having to manage the thread creation and the handler manipulation.

In this chapter we will cover the following topics:

  • Introducing AsyncTask
  • Declaring AsyncTask types
  • Executing AsyncTasks
  • Providing indeterministic progress feedback
  • Providing deterministic progress feedback
  • Canceling an AsyncTask
  • Handling exceptions
  • Controlling the level of concurrency
  • Common AsyncTask issues
  • Applications of AsyncTask
主站蜘蛛池模板: 新密市| 喀喇沁旗| 通道| 镇江市| 明溪县| 崇信县| 白玉县| 泽普县| 锡林郭勒盟| 昭觉县| 嫩江县| 伊宁市| 金堂县| 班玛县| 剑河县| 聂荣县| 武强县| 盖州市| 盐城市| 奉贤区| 顺平县| 汤原县| 双鸭山市| 如东县| 酉阳| 斗六市| 边坝县| 栾川县| 鄂尔多斯市| 永清县| 外汇| 荔波县| 高唐县| 渭南市| 海林市| 谢通门县| 南安市| 仁化县| 黔东| 九江县| 永平县|