现在的位置: 首页 > 综合 > 正文

sendMessage and sendEmptyMessage

2013年08月06日 ⁄ 综合 ⁄ 共 423字 ⁄ 字号 评论关闭

/**
* 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可以放其他的数据。

抱歉!评论已关闭.