a summary of handler.
Message: Messages, including the message ID, the message processing object and the processing of data, etc., by the MessageQueue Unified Queue, the final processing 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 for storing messages sent by Handler and running in accordance with 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, which continuously extracts the message from the MessageQueue to run. Therefore, a MessageQueue needs a Looper.
Thread: Threads that are responsible for dispatching the entire message loop, which is where the message loop runs.
As seen, 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 UI looper, we are able to update the UI interface!
The relationship between Android development handler and Looper