public void onMounted(String mountPoint) {
LogUtils.i(TAG,"onMounted,mountPoint="+mountPoint);
Message.obtain(mHandler,MSG_DO_MOUNTED,mountPoint).sendToTarget();
}
源码分析:
Return a new Message instance from the global pool. Allows us to avoid allocating new objects in many cases.
Same as
obtain()
, but copies the values of an existing message (including its target) into the new one.
Parameters:
-
orig
Original message to copy.
Returns:
-
A Message object from the global pool.
m.replyTo = orig.replyTo;
m.sendingUid = orig.sendingUid;
m.data = new Bundle(orig.data);
m.callback = orig.callback;
Same as
obtain()
, but sets the value for the
target member on the Message returned.
Parameters:
-
h
Handler to assign to the returned Message object's
target member.
Returns:
-
A Message object from the global pool.
Same as
obtain(android.os.Handler)
, but assigns a callback Runnable on the Message that is returned.
Parameters:
-
h
Handler to assign to the returned Message object's
target member.
-
callback
Runnable that will execute when the message is handled.
Returns:
-
A Message object from the global pool.
Same as
obtain()
, but sets the values for both
target and
what members on the Message.
Parameters:
-
h
Value to assign to the
target member.
-
what
Value to assign to the
what member.
Returns:
-
A Message object from the global pool.
Same as
obtain()
, but sets the values of the
target,
what, and
obj members.
Parameters:
-
h
The
target value to set.
-
what
The
what value to set.
-
obj
The
object method to set.
Returns:
-
A Message object from the global pool.
Same as
obtain()
, but sets the values of the
target,
what,
arg1, and
arg2 members.
Parameters:
-
h
The
target value to set.
-
what
The
what value to set.
-
arg1
The
arg1 value to set.
-
arg2
The
arg2 value to set.
Returns:
-
A Message object from the global pool.
Same as
obtain()
, but sets the values of the
target,
what,
arg1,
arg2, and
obj members.
Parameters:
-
h
The
target value to set.
-
what
The
what value to set.
-
arg1
The
arg1 value to set.
-
arg2
The
arg2 value to set.
-
obj
The
obj value to set.
Returns:
-
A Message object from the global pool.
int arg1, int arg2, Object obj) {
Sends this Message to the Handler specified by
getTarget()
. Throws a null pointer exception if this field has not been set.
Pushes a message onto the end of the message queue after all pending messages before the current time. It will be received in
handleMessage(android.os.Message)
, in the thread attached to this handler.
Returns:
-
Returns true if the message was successfully placed in to the message queue. Returns false on failure, usually because the looper processing the message queue is exiting.
Enqueue a message into the message queue after all pending messages before (current time + delayMillis). You will receive it in
handleMessage(android.os.Message)
, in the thread attached to this handler.
Returns:
-
Returns true if the message was successfully placed in to the message queue. Returns false on failure, usually because the looper processing the message queue is exiting. Note that a result of true does not mean the message will be processed -- if the looper is quit before the delivery time of the message occurs then the message will be dropped.