Message.Obtain Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| Obtain(Handler, Int32, Int32, Int32, Object) |
Same as |
| Obtain(Handler, Int32, Int32, Int32) |
Same as |
| Obtain(Handler, Int32, Object) |
Same as |
| Obtain(Handler, Int32) |
Same as |
| Obtain(Handler, Action) |
Obtains a message with the specified handler and callback, using the message pool when possible. |
| Obtain(Handler, IRunnable) |
Same as |
| Obtain(Message) |
Same as |
| Obtain(Handler) |
Same as |
| 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 target, what,
arg1, arg2, and obj 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 target value to set.
- what
- Int32
The what value to set.
- arg1
- Int32
The arg1 value to set.
- arg2
- Int32
The arg2 value to set.
- obj
- Object
The obj value to set.
Returns
A Message object from the global pool.
- Attributes
Remarks
Same as #obtain(), but sets the values of the target, what, arg1, arg2, and obj members.
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 target, what,
arg1, and arg2 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 target value to set.
- what
- Int32
The what value to set.
- arg1
- Int32
The arg1 value to set.
- arg2
- Int32
The arg2 value to set.
Returns
A Message object from the global pool.
- Attributes
Remarks
Same as #obtain(), but sets the values of the target, what, arg1, and arg2 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 target, what, and obj
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 target value to set.
- what
- Int32
The what value to set.
- obj
- Object
The object method to set.
Returns
A Message object from the global pool.
- Attributes
Remarks
Same as #obtain(), but sets the values of the target, what, and obj 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 target and
what 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 target member.
- what
- Int32
Value to assign to the what member.
Returns
A Message object from the global pool.
- Attributes
Remarks
Same as #obtain(), but sets the values for both target and what 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)
Obtains a message with the specified handler and callback, using the message pool when possible.
public static Android.OS.Message? Obtain(Android.OS.Handler h, Action callback);
static member Obtain : Android.OS.Handler * Action -> Android.OS.Message
Parameters
- h
- Handler
The handler for the message.
- callback
- Action
The callback to invoke.
Returns
The requested value.
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 target 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 target 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 target member.
Returns
A Message object from the global pool.
- Attributes
Remarks
Same as #obtain(), but sets the value for the target 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
The requested value.
- 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.