Lines Matching defs:Handler
25 * A Handler allows you to send and process {@link Message} and Runnable
26 * objects associated with a thread's {@link MessageQueue}. Each Handler
28 * queue. When you create a new Handler, it is bound to the thread /
33 * <p>There are two main uses for a Handler: (1) to schedule messages and
45 * processed by the Handler's {@link #handleMessage} method (requiring that
46 * you implement a subclass of Handler).
48 * <p>When posting or sending to a Handler, you can either
59 * the main application thread through a Handler. This is done by calling
62 * in the Handler's message queue and processed when appropriate.
64 public class Handler {
67 * that extend this Handler class and that are not static. These kind
71 private static final String TAG = "Handler";
74 * Callback interface you can use when instantiating a Handler to avoid
75 * having to implement your own subclass of Handler.
104 * Default constructor associates this handler with the queue for the
107 * If there isn't one, this handler won't be able to receive messages.
109 public Handler() {
111 final Class<? extends Handler> klass = getClass();
114 Log.w(TAG, "The following Handler class should be static or leaks might occur: " +
122 "Can't create handler inside thread that has not called Looper.prepare()");
129 * Constructor associates this handler with the queue for the
133 public Handler(Callback callback) {
135 final Class<? extends Handler> klass = getClass();
138 Log.w(TAG, "The following Handler class should be static or leaks might occur: " +
146 "Can't create handler inside thread that has not called Looper.prepare()");
155 public Handler(Looper looper) {
165 public Handler(Looper looper, Callback callback) {
188 * creating and allocating new instances. The retrieved message has its handler set to this instance (Message.target == this).
252 * The runnable will be run on the thread to which this handler is
270 * The runnable will be run on the thread to which this handler is attached.
292 * The runnable will be run on the thread to which this handler is attached.
315 * The runnable will be run on the thread to which this handler
338 * handler is attached.
375 * in the thread attached to this handler.
432 * {@link #handleMessage}, in the thread attached to this handler.
454 * to this handler.
486 * {@link #handleMessage}, in the thread attached to this handler.
553 // if we can get rid of this method, the handler need not remember its loop
570 return "Handler (" + getClass().getName() + ") {"
587 Handler.this.sendMessage(msg);