- Asynchronous Android Programming(Second Edition)
- Helder Vasconcelos
- 160字
- 2021-07-14 10:43:14
Summary
In this chapter, we learned how to use Handler
to queue work for the main thread and how to use Looper
to build up a queueing infrastructure for our own Thread
.
We saw the different ways in which we can define work with Handler
: arbitrary work defined at the call site with Runnable
or predefined work implemented in the Handler
itself and triggered by message-sending.
In the meantime, we learned how to defer work properly without leaking memory on the way.
We learned how to use Handler
in a multithreaded application to pass work and results back and forth between cooperating threads, performing blocking operations on an ordinary background thread and communicating the results back to the main thread to update the user interface.
In the next chapter, we'll start to build responsive applications by applying the AsyncTask
instance to execute work in the background using pools of threads and returning progress updates and results to the main thread.
- PHP動態網站程序設計
- Python程序設計教程(第2版)
- The Modern C++ Challenge
- Leap Motion Development Essentials
- 新手學Visual C# 2008程序設計
- 深度強化學習算法與實踐:基于PyTorch的實現
- Learning Apache Kafka(Second Edition)
- Android Native Development Kit Cookbook
- 蘋果的產品設計之道:創建優秀產品、服務和用戶體驗的七個原則
- HTML5開發精要與實例詳解
- Scrapy網絡爬蟲實戰
- SAP Web Dynpro for ABAP開發技術詳解:基礎應用
- Android應用開發攻略
- Java 9:Building Robust Modular Applications
- INSTANT Lift Web Applications How-to