01.Handler发送消息
Handler 发送消息的形式主要有以下几种形式,其最终调用的都是
sendMessageAtTime()
方法1
2
3
4
5
6
7
8
9
10
11
12
13
14public final boolean sendMessage(Message msg){
return sendMessageDelayed(msg, 0);
}
public final boolean post(Runnable r){
return sendMessageDelayed(getPostMessage(r), 0);
}
public final boolean sendMessageDelayed(Message msg, long delayMillis){
if (delayMillis < 0) {
delayMillis = 0;
}
return sendMessageAtTime(msg, SystemClock.uptimeMillis() + delayMillis);
}