Build 1.0_r1(from source)

android.os
Class MessageQueue

java.lang.Object
  extended by android.os.MessageQueue

public class MessageQueue
extends Object

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().


Nested Class Summary
static interface MessageQueue.IdleHandler
          Callback interface for discovering when a thread is going to block waiting for more messages.
 
Field Summary
(package private)  Message mMessages
           
(package private)  boolean mQuitAllowed
           
 
Constructor Summary
MessageQueue()
           
 
Method Summary
 void addIdleHandler(MessageQueue.IdleHandler handler)
          Add a new MessageQueue.IdleHandler to this message queue.
(package private)  boolean enqueueMessage(Message msg, long when)
           
(package private)  Message next()
           
(package private)  void poke()
           
(package private)  Message pullNextLocked(long now)
           
(package private)  void removeCallbacksAndMessages(Handler h, Object object)
           
 void removeIdleHandler(MessageQueue.IdleHandler handler)
          Remove an MessageQueue.IdleHandler from the queue that was previously added with addIdleHandler(android.os.MessageQueue.IdleHandler).
(package private)  boolean removeMessages(Handler h, int what, Object object, boolean doRemove)
           
(package private)  void removeMessages(Handler h, Runnable r, Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mMessages

Message mMessages

mQuitAllowed

boolean mQuitAllowed
Constructor Detail

MessageQueue

MessageQueue()
Method Detail

addIdleHandler

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(android.os.MessageQueue.IdleHandler).

This method is safe to call from any thread.

Parameters:
handler - The IdleHandler to be added.

removeIdleHandler

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

Parameters:
handler - The IdleHandler to be removed.

next

final Message next()

pullNextLocked

final Message pullNextLocked(long now)

enqueueMessage

final boolean enqueueMessage(Message msg,
                             long when)

removeMessages

final boolean removeMessages(Handler h,
                             int what,
                             Object object,
                             boolean doRemove)

removeMessages

final void removeMessages(Handler h,
                          Runnable r,
                          Object object)

removeCallbacksAndMessages

final void removeCallbacksAndMessages(Handler h,
                                      Object object)

poke

void poke()

Build 1.0_r1(from source)

Please submit a feedback, bug or feature