- 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.
- 復雜軟件設計之道:領域驅動設計全面解析與實戰
- Arduino by Example
- Production Ready OpenStack:Recipes for Successful Environments
- Python王者歸來
- 零基礎學Java(第4版)
- 教孩子學編程:C++入門圖解
- Scientific Computing with Scala
- OpenCV 4計算機視覺項目實戰(原書第2版)
- 輕松上手2D游戲開發:Unity入門
- Hands-On Kubernetes on Windows
- Web App Testing Using Knockout.JS
- 人人都能開發RPA機器人:UiPath從入門到實戰
- 大學計算機應用基礎(Windows 7+Office 2010)(IC3)
- Java程序設計教程
- RESTful Web API Design with Node.js