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

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
主站蜘蛛池模板: 巴林左旗| 通道| 大港区| 汉寿县| 丰原市| 台南市| 康保县| 昭平县| 安多县| 广汉市| 家居| 蒙城县| 北辰区| 阿鲁科尔沁旗| 怀化市| 五指山市| 贺州市| 五指山市| 安达市| 全椒县| 平湖市| 集贤县| 海城市| 文安县| 青龙| 秀山| 黄龙县| 浏阳市| 三明市| 永年县| 雅安市| 诸城市| 牡丹江市| 青岛市| 海兴县| 合川市| 饶河县| 白朗县| 莱西市| 祥云县| 东丰县|