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

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
主站蜘蛛池模板: 黄石市| 黄陵县| 缙云县| 辰溪县| 平江县| 阜阳市| 玉龙| 长寿区| 虹口区| 志丹县| 汶上县| 赣榆县| 江川县| 崇明县| 赤壁市| 屯留县| 曲松县| 富阳市| 沙坪坝区| 湾仔区| 夏津县| 凭祥市| 和田市| 莱阳市| 五峰| 鹿泉市| 民县| 唐海县| 广西| 土默特右旗| 格尔木市| 抚远县| 平阴县| 陇川县| 沙田区| 乐山市| 潮安县| 广饶县| 白山市| 桐庐县| 永平县|