Thread Looper Handler

时间:2014-03-26 18:40:09

标签: android handler looper

Thread = Worked Thread (not a main Thread/ UI Thread)
Looper.prepare(); = Attached MessageQueue with worker Thread

MessageQueue仅分配了主线程,现在它也可以在Looper的帮助下与工作线程一起使用

Looper.loop(); = start process message Queue

//Handler handler (somewhere declared globally)

handler = new Handler(); //attached handler to looper

handler instance will be use to post Message/Runnable in MessageQueue

我的问题是,那么

的重要性是什么
public void handleMessage(android.os.Message msg);

为什么我重写它????

0 个答案:

没有答案