Why does Looper.loop() not block the UI thread
问题 This is the code in ActivityThread.main(): public static void main(String[] args) { ...... Looper.prepareMainLooper(); ... Looper.loop(); throw new RuntimeException("Main thread loop unexpectedly exited"); } It made the Looper running. There is a loop running in the Looper.loop() all the time. Why does Looper.loop() not block the UI thread? 回答1: Looper.loop() prepares the Looper to run the messages that are passed to the thread. It doesn't blindly keep iterating over itself, rather it uses a