What is the relationship between Looper , Handler and MessageQueue in Android?
What is the relationship between Looper , Handler and MessageQueue in Android?
The relationship between Looper, Handler, and MessageQueue in Android is as follows:
Looper is responsible for creating a message loop for a thread. It retrieves messages from the MessageQueue and dispatches them to the appropriate Handler.
MessageQueue is a queue that stores the messages to be processed by the Looper. Messages are added to the queue by Handlers.
Handler is used to send and process messages and runnables. It enqueues messages into the MessageQueue associated with the Looper of the thread it was created in.
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.