/**
* Sends a Message containing only the what value.
*/
public final boolean sendEmptyMessage(int what)
{
return sendEmptyMessageDelayed(what, 0);
}
/**
* Pushes a message onto the end of the message queue after all pending messages
* before the current time. It will be received in {@link #handleMessage},
* in the thread attached to this handler.
*/
public final boolean sendMessage(Message msg)
{
return sendMessageDelayed(msg, 0);
}sendEmptyMessage()只能放int型数据,而sendMessage可以放其他的数据。
本文详细介绍了Android中Handler类的sendEmptyMessage和sendMessage方法的区别及使用方式。sendEmptyMessage仅能发送int类型的消息,而sendMessage则可以发送更复杂的数据。
1235

被折叠的 条评论
为什么被折叠?



