官术网_书友最值得收藏!

Chapter 2. Performing Work with Looper, Handler, and HandlerThread

In the previous chapter, you were introduced to the most basic concurrent issues that a developer might face while developing a responsive and concurrent Android application. As the most interactable items run on the main thread, it is crucial to coordinate the backgrounds code to handle the work without any UI stuttering that compromises the user experience.

In this chapter, we will meet some of most fundamental constructs used on Android systems to perform tasks and schedule on a main thread or an ordinary background thread created by the developer to perform and schedule tasks long-running operations.

We will cover the following topics:

  • Understanding Looper
  • Understanding Handler
  • Sending work to Looper
  • Scheduling work with post
  • Using Handler to defer work
  • Leaking implicit references
  • Leaking explicit references
  • Updating the UI with Handler
  • Canceling pending messages
  • Multithreading with Handler and HandlerThread
  • Applications of Handler and HandlerThread
主站蜘蛛池模板: 广饶县| 英吉沙县| 肇东市| 砚山县| 肥乡县| 从化市| 封丘县| 光泽县| 珲春市| 大冶市| 莱芜市| 岳阳县| 岱山县| 长泰县| 兖州市| 柳河县| 汉沽区| 平塘县| 赣榆县| 壶关县| 新河县| 南漳县| 伊宁市| 莱芜市| 凤山县| 翼城县| 临清市| 巩义市| 阳春市| 泸水县| 抚顺市| 罗平县| 专栏| 尤溪县| 防城港市| 安丘市| 洞头县| 土默特左旗| 博罗县| 华宁县| 驻马店市|