- Asynchronous Android Programming(Second Edition)
- Helder Vasconcelos
- 155字
- 2021-07-14 10:43:13
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
推薦閱讀
- Java異步編程實戰
- Spring Cloud Alibaba微服務架構設計與開發實戰
- C語言程序設計基礎與實驗指導
- 數據結構(Java語言描述)
- PyTorch自然語言處理入門與實戰
- Mastering Android Development with Kotlin
- Working with Odoo
- Building Microservices with .NET Core
- SciPy Recipes
- 機器學習微積分一本通(Python版)
- Mastering Apache Storm
- Python Social Media Analytics
- Getting Started with hapi.js
- Instant Pygame for Python Game Development How-to
- Cinder:Begin Creative Coding