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

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
主站蜘蛛池模板: 化隆| 武邑县| 获嘉县| 正蓝旗| 二连浩特市| 南通市| 镶黄旗| 泸西县| 虞城县| 大同市| 新宁县| 阜平县| 县级市| 资源县| 长乐市| 漾濞| 玉林市| 彩票| 泰宁县| 宁陕县| 绥滨县| 苏尼特左旗| 红安县| 元阳县| 顺义区| 东乡县| 万盛区| 马尔康县| 郎溪县| 石楼县| 巴林右旗| 乃东县| 宜君县| 台东县| 黎城县| 依兰县| 桂东县| 玉林市| 梧州市| 白城市| 肇庆市|