Java android.os Handler fields, constructors, methods, implement or subclass

Example usage for Java android.os Handler fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.os Handler.

The text is from its open source code.

Subclass

android.os.Handler has subclasses.
Click this link to see all its subclasses.

Constructor

Handler()
Default constructor associates this handler with the Looper for the current thread.
Handler(Callback callback)
Constructor associates this handler with the Looper for the current thread and takes a callback interface in which you can handle messages.
Handler(Looper looper)
Use the provided Looper instead of the default one.
Handler(boolean async)
Use the Looper for the current thread and set whether the handler should be asynchronous.
Handler(Looper looper, Callback callback)
Use the provided Looper instead of the default one and take a callback interface in which to handle messages.
Handler(Callback callback, boolean async)
Use the Looper for the current thread with the specified callback interface and set whether the handler should be asynchronous.

Method

voiddispatchMessage(Message msg)
Handle system messages here.
booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
LoopergetLooper()
voidhandleMessage(Message msg)
Subclasses must implement this to receive messages.
booleanhasMessages(int what)
Check if there are any pending posts of messages with code 'what' in the message queue.
MessageobtainMessage(int what)
Same as #obtainMessage() , except that it also sets the what member of the returned Message.
MessageobtainMessage(int what, Object obj)
Same as #obtainMessage() , except that it also sets the what and obj members of the returned Message.
MessageobtainMessage()
Returns a new android.os.Message Message from the global message pool.
MessageobtainMessage(int what, int arg1, int arg2, Object obj)
Same as #obtainMessage() , except that it also sets the what, obj, arg1,and arg2 values on the returned Message.
booleanpost(Runnable r)
Causes the Runnable r to be added to the message queue.
booleanpostAtFrontOfQueue(Runnable r)
Posts a message to an object that implements Runnable.
booleanpostAtTime(Runnable r, long uptimeMillis)
Causes the Runnable r to be added to the message queue, to be run at a specific time given by uptimeMillis.
booleanpostDelayed(Runnable r, long delayMillis)
Causes the Runnable r to be added to the message queue, to be run after the specified amount of time elapses.
voidremoveCallbacks(Runnable r)
Remove any pending posts of Runnable r that are in the message queue.
voidremoveCallbacksAndMessages(Object token)
Remove any pending posts of callbacks and sent messages whose obj is token.
voidremoveMessages(int what)
Remove any pending posts of messages with code 'what' that are in the message queue.
voidremoveMessages(int what, Object object)
Remove any pending posts of messages with code 'what' and whose obj is 'object' that are in the message queue.
booleansendEmptyMessage(int what)
Sends a Message containing only the what value.
booleansendEmptyMessageDelayed(int what, long delayMillis)
Sends a Message containing only the what value, to be delivered after the specified amount of time elapses.
booleansendMessage(Message msg)
Pushes a message onto the end of the message queue after all pending messages before the current time.
booleansendMessageAtFrontOfQueue(Message msg)
Enqueue a message at the front of the message queue, to be processed on the next iteration of the message loop.
booleansendMessageDelayed(Message msg, long delayMillis)
Enqueue a message into the message queue after all pending messages before (current time + delayMillis).