Handler
A Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue.
Each Handler instance is associated with a single thread and that thread's message queue.
When you create a new Handler, it is bound to the thread / message queue of the thread that is creating it -- from that point on,
it will deliver messages and runnables to that message queue and execute them as they come out of the message queue.
uses for a Handler
(1) to schedule messages and runnables to be executed as some point in the future;
(2) to enqueue an action to be performed on a different thread than your own.
Schedule msgs by the methods
1. post(Runnable),
2. postAtTime(Runnable, long),
3. postDelayed(Runnable, long),
4. sendEmptyMessage(int),
5. sendMessage(Message),
6. sendMessageAtTime(Message, long),
7. sendMessageDelayed(Message, long)
No comments:
Post a Comment