- Asynchronous Android Programming(Second Edition)
- Helder Vasconcelos
- 148字
- 2021-07-14 10:43:14
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
推薦閱讀
- Mastering Ext JS(Second Edition)
- Java EE 6 企業(yè)級應(yīng)用開發(fā)教程
- Azure IoT Development Cookbook
- 看透JavaScript:原理、方法與實踐
- Python進(jìn)階編程:編寫更高效、優(yōu)雅的Python代碼
- Highcharts Cookbook
- Oracle從入門到精通(第5版)
- Unreal Engine 4 Shaders and Effects Cookbook
- SQL Server從入門到精通(第3版)
- 計算機(jī)應(yīng)用基礎(chǔ)實踐教程
- Visual Basic程序設(shè)計習(xí)題與上機(jī)實踐
- OpenCV with Python By Example
- Learning Modular Java Programming
- Web Developer's Reference Guide
- HTML5移動前端開發(fā)基礎(chǔ)與實戰(zhàn)(微課版)