- 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
推薦閱讀
- 數(shù)據(jù)科學(xué)實(shí)戰(zhàn)手冊(cè)(R+Python)
- Git Version Control Cookbook
- JavaScript+DHTML語法與范例詳解詞典
- Gradle for Android
- Java程序設(shè)計(jì)
- 微信小程序項(xiàng)目開發(fā)實(shí)戰(zhàn)
- Unity 5 for Android Essentials
- .NET 3.5編程
- Android應(yīng)用案例開發(fā)大全(第二版)
- Swift 4 Protocol-Oriented Programming(Third Edition)
- Developing SSRS Reports for Dynamics AX
- Qlik Sense? Cookbook
- PrimeFaces Blueprints
- Arduino機(jī)器人系統(tǒng)設(shè)計(jì)及開發(fā)
- HTML并不簡(jiǎn)單:Web前端開發(fā)精進(jìn)秘籍