- 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.
- 自然語言處理實戰:預訓練模型應用及其產品化
- Azure IoT Development Cookbook
- CentOS 7 Server Deployment Cookbook
- Magento 2 Theme Design(Second Edition)
- 樂高機器人設計技巧:EV3結構設計與編程指導
- OpenCV 3和Qt5計算機視覺應用開發
- Bulma必知必會
- 深入淺出Windows API程序設計:編程基礎篇
- Hands-On Microservices with Kotlin
- Hands-On Functional Programming with TypeScript
- NGINX Cookbook
- FPGA嵌入式項目開發實戰
- 數字媒體技術概論
- 安卓工程師教你玩轉Android
- C++面向對象程序設計