public class

MessageQueue

extends Object
java.lang.Object
   ↳ android.os.MessageQueue

Class Overview

Low-level class holding the list of messages to be dispatched by a Looper. Messages are not added directly to a MessageQueue, but rather through MessageQueue.IdleHandler objects associated with the Looper.

You can retrieve the MessageQueue for the current thread with Looper.myQueue().

Summary

Nested Classes
public class MessageQueue.IdleHandler Callback interface for discovering when a thread is going to block waiting for more messages. 
Public Methods
final void addIdleHandler(MessageQueue.IdleHandler handler)
Add a new MessageQueue.IdleHandler to this message queue.
final void removeIdleHandler(MessageQueue.IdleHandler handler)
Remove an MessageQueue.IdleHandler from the queue that was previously added with addIdleHandler(MessageQueue.IdleHandler).
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public final void addIdleHandler (MessageQueue.IdleHandler handler)

Add a new MessageQueue.IdleHandler to this message queue. This may be removed automatically for you by returning false from IdleHandler.queueIdle() when it is invoked, or explicitly removing it with removeIdleHandler(MessageQueue.IdleHandler).

This method is safe to call from any thread.

Parameters
handler The IdleHandler to be added.

public final void removeIdleHandler (MessageQueue.IdleHandler handler)

Remove an MessageQueue.IdleHandler from the queue that was previously added with addIdleHandler(MessageQueue.IdleHandler). If the given object is not currently in the idle list, nothing is done.

Parameters
handler The IdleHandler to be removed.