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

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
主站蜘蛛池模板: 岳西县| 新巴尔虎右旗| 临澧县| 高碑店市| 桂平市| 前郭尔| 栖霞市| 简阳市| 万源市| 新龙县| 新津县| 汝州市| 依兰县| 瓮安县| 澄迈县| 罗田县| 云霄县| 台安县| 额济纳旗| 嘉峪关市| 仁寿县| 北流市| 麻阳| 龙江县| 聊城市| 阿拉善左旗| 吴旗县| 乐平市| 无锡市| 眉山市| 临夏县| 娄烦县| 台安县| 抚松县| 青岛市| 定西市| 昌平区| 高淳县| 和龙市| 抚顺县| 奈曼旗|