~/talk

Looper.loop() - Understanding Android's Message Queue

Talkat droidcon San Francisco 2017 · 2017-11-05..11-06· [android, concurrency]
name:Tony Lenz
links:none on file

Explains how Android really calls app code: the system boots a zygote forked process, ActivityThread runs a main Looper.loop that processes one message at a time, and handlers post messages into that queue. Shows that a fresh project generates 87 files, that configuration-change relaunch (message 126) runs teardown and onRetainCustomNonConfigurationInstance and creation in the same message (so posted results aren’t lost), demos setMessageLogging, recommends custom message queues over blind handler.post and to keep work off the main thread.

AI-written summary · about

  1. 0:00Introduction to Looper
  2. 4:58Zygote and Activity Thread
  3. 7:47Looper.loop() Explained
  4. 13:28Handling Configuration Changes
  5. 19:54Thread Safety with Handlers
  6. 22:46Choreographer and Frame Updates
  7. 25:35Native Message Queue
  8. 27:01Main Thread Optimization Tips
  9. 28:28Q&A and Resources
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.