共用方式為


Message.Obtain Method

Definition

Overloads

Obtain(Handler, Int32, Int32, Int32, Object)

Same as #obtain(), but sets the values of the <em>target</em>, <em>what</em>, <em>arg1</em>, <em>arg2</em>, and <em>obj</em> members.

Obtain(Handler, Int32, Int32, Int32)

Same as #obtain(), but sets the values of the <em>target</em>, <em>what</em>, <em>arg1</em>, and <em>arg2</em> members.

Obtain(Handler, Int32, Object)

Same as #obtain(), but sets the values of the <em>target</em>, <em>what</em>, and <em>obj</em> members.

Obtain(Handler, Int32)

Same as #obtain(), but sets the values for both <em>target</em> and <em>what</em> members on the Message.

Obtain(Handler, Action)
Obtain(Handler, IRunnable)

Same as #obtain(Handler), but assigns a callback Runnable on the Message that is returned.

Obtain(Message)

Same as #obtain(), but copies the values of an existing message (including its target) into the new one.

Obtain(Handler)

Same as #obtain(), but sets the value for the <em>target</em> member on the Message returned.

Obtain()

Return a new Message instance from the global pool.

Obtain(Handler, Int32, Int32, Int32, Object)

Same as #obtain(), but sets the values of the <em>target</em>, <em>what</em>, <em>arg1</em>, <em>arg2</em>, and <em>obj</em> members.

[Android.Runtime.Register("obtain", "(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;", "")]
public static Android.OS.Message? Obtain (Android.OS.Handler? h, int what, int arg1, int arg2, Java.Lang.Object? obj);
[<Android.Runtime.Register("obtain", "(Landroid/os/Handler;IIILjava/lang/Object;)Landroid/os/Message;", "")>]
static member Obtain : Android.OS.Handler * int * int * int * Java.Lang.Object -> Android.OS.Message

Parameters

h
Handler

The <em>target</em> value to set.

what
Int32

The <em>what</em> value to set.

arg1
Int32

The <em>arg1</em> value to set.

arg2
Int32

The <em>arg2</em> value to set.

obj
Object

The <em>obj</em> value to set.

Returns

A Message object from the global pool.

Attributes

Remarks

Same as #obtain(), but sets the values of the <em>target</em>, <em>what</em>, <em>arg1</em>, <em>arg2</em>, and <em>obj</em> members.

Java documentation for android.os.Message.obtain(android.os.Handler, int, int, int, java.lang.Object).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Obtain(Handler, Int32, Int32, Int32)

Same as #obtain(), but sets the values of the <em>target</em>, <em>what</em>, <em>arg1</em>, and <em>arg2</em> members.

[Android.Runtime.Register("obtain", "(Landroid/os/Handler;III)Landroid/os/Message;", "")]
public static Android.OS.Message? Obtain (Android.OS.Handler? h, int what, int arg1, int arg2);
[<Android.Runtime.Register("obtain", "(Landroid/os/Handler;III)Landroid/os/Message;", "")>]
static member Obtain : Android.OS.Handler * int * int * int -> Android.OS.Message

Parameters

h
Handler

The <em>target</em> value to set.

what
Int32

The <em>what</em> value to set.

arg1
Int32

The <em>arg1</em> value to set.

arg2
Int32

The <em>arg2</em> value to set.

Returns

A Message object from the global pool.

Attributes

Remarks

Same as #obtain(), but sets the values of the <em>target</em>, <em>what</em>, <em>arg1</em>, and <em>arg2</em> members.

Java documentation for android.os.Message.obtain(android.os.Handler, int, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Obtain(Handler, Int32, Object)

Same as #obtain(), but sets the values of the <em>target</em>, <em>what</em>, and <em>obj</em> members.

[Android.Runtime.Register("obtain", "(Landroid/os/Handler;ILjava/lang/Object;)Landroid/os/Message;", "")]
public static Android.OS.Message? Obtain (Android.OS.Handler? h, int what, Java.Lang.Object? obj);
[<Android.Runtime.Register("obtain", "(Landroid/os/Handler;ILjava/lang/Object;)Landroid/os/Message;", "")>]
static member Obtain : Android.OS.Handler * int * Java.Lang.Object -> Android.OS.Message

Parameters

h
Handler

The <em>target</em> value to set.

what
Int32

The <em>what</em> value to set.

obj
Object

The <em>object</em> method to set.

Returns

A Message object from the global pool.

Attributes

Remarks

Same as #obtain(), but sets the values of the <em>target</em>, <em>what</em>, and <em>obj</em> members.

Java documentation for android.os.Message.obtain(android.os.Handler, int, java.lang.Object).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Obtain(Handler, Int32)

Same as #obtain(), but sets the values for both <em>target</em> and <em>what</em> members on the Message.

[Android.Runtime.Register("obtain", "(Landroid/os/Handler;I)Landroid/os/Message;", "")]
public static Android.OS.Message? Obtain (Android.OS.Handler? h, int what);
[<Android.Runtime.Register("obtain", "(Landroid/os/Handler;I)Landroid/os/Message;", "")>]
static member Obtain : Android.OS.Handler * int -> Android.OS.Message

Parameters

h
Handler

Value to assign to the <em>target</em> member.

what
Int32

Value to assign to the <em>what</em> member.

Returns

A Message object from the global pool.

Attributes

Remarks

Same as #obtain(), but sets the values for both <em>target</em> and <em>what</em> members on the Message.

Java documentation for android.os.Message.obtain(android.os.Handler, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Obtain(Handler, Action)

public static Android.OS.Message? Obtain (Android.OS.Handler h, Action callback);
static member Obtain : Android.OS.Handler * Action -> Android.OS.Message

Parameters

callback
Action

Returns

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Obtain(Handler, IRunnable)

Same as #obtain(Handler), but assigns a callback Runnable on the Message that is returned.

[Android.Runtime.Register("obtain", "(Landroid/os/Handler;Ljava/lang/Runnable;)Landroid/os/Message;", "")]
public static Android.OS.Message? Obtain (Android.OS.Handler? h, Java.Lang.IRunnable? callback);
[<Android.Runtime.Register("obtain", "(Landroid/os/Handler;Ljava/lang/Runnable;)Landroid/os/Message;", "")>]
static member Obtain : Android.OS.Handler * Java.Lang.IRunnable -> Android.OS.Message

Parameters

h
Handler

Handler to assign to the returned Message object's <em>target</em> member.

callback
IRunnable

Runnable that will execute when the message is handled.

Returns

A Message object from the global pool.

Attributes

Remarks

Same as #obtain(Handler), but assigns a callback Runnable on the Message that is returned.

Java documentation for android.os.Message.obtain(android.os.Handler, java.lang.Runnable).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Obtain(Message)

Same as #obtain(), but copies the values of an existing message (including its target) into the new one.

[Android.Runtime.Register("obtain", "(Landroid/os/Message;)Landroid/os/Message;", "")]
public static Android.OS.Message? Obtain (Android.OS.Message? orig);
[<Android.Runtime.Register("obtain", "(Landroid/os/Message;)Landroid/os/Message;", "")>]
static member Obtain : Android.OS.Message -> Android.OS.Message

Parameters

orig
Message

Original message to copy.

Returns

A Message object from the global pool.

Attributes

Remarks

Same as #obtain(), but copies the values of an existing message (including its target) into the new one.

Java documentation for android.os.Message.obtain(android.os.Message).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Obtain(Handler)

Same as #obtain(), but sets the value for the <em>target</em> member on the Message returned.

[Android.Runtime.Register("obtain", "(Landroid/os/Handler;)Landroid/os/Message;", "")]
public static Android.OS.Message? Obtain (Android.OS.Handler? h);
[<Android.Runtime.Register("obtain", "(Landroid/os/Handler;)Landroid/os/Message;", "")>]
static member Obtain : Android.OS.Handler -> Android.OS.Message

Parameters

h
Handler

Handler to assign to the returned Message object's <em>target</em> member.

Returns

A Message object from the global pool.

Attributes

Remarks

Same as #obtain(), but sets the value for the <em>target</em> member on the Message returned.

Java documentation for android.os.Message.obtain(android.os.Handler).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Obtain()

Return a new Message instance from the global pool.

[Android.Runtime.Register("obtain", "()Landroid/os/Message;", "")]
public static Android.OS.Message? Obtain ();
[<Android.Runtime.Register("obtain", "()Landroid/os/Message;", "")>]
static member Obtain : unit -> Android.OS.Message

Returns

Attributes

Remarks

Return a new Message instance from the global pool. Allows us to avoid allocating new objects in many cases.

Java documentation for android.os.Message.obtain().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to