a summary of handler.
message: Messages that contain the message ID, the message processing object, and the processed data are queued by MessageQueue and processed by Handler .
Handler: Handler, responsible for sending and processing the message. When using Handler , you need to implement the handlemessage (message msg) method to process a specific message , such as updating the UI such as
MessageQueue: Message Queuing, which holds messages sent by Handler and executes according to FIFO rules. Of course, storing a message is not a meaningful preservation, but rather a concatenation of the message in the form of a linked list, waiting for the Looper to be extracted.
Looper: The message pump continuously extracts message execution from the MessageQueue . Therefore, a MessageQueue needs a Looper.
Thread: Threads that are responsible for dispatching the entire message loop, that is, the execution site of the message loop.
, handler is responsible for stacking the data into the end of the message and extracting the data from the team head, while Looper is responsible for looping out the queue to get handler data. Note that Looper must be the looper of the UI to be able to update the UI interface!