Share via


Object.GetObject Method

Definition

Overloads

GetObject<T>(IntPtr, IntPtr, JniHandleOwnership)
GetObject<T>(IntPtr, JniHandleOwnership)

Wraps a JNI object reference into a fully typed IJavaObject implementation.

GetObject<T>(IntPtr, IntPtr, JniHandleOwnership)

public static T? GetObject<T> (IntPtr jnienv, IntPtr handle, Android.Runtime.JniHandleOwnership transfer) where T : class, Android.Runtime.IJavaObject;
static member GetObject : nativeint * nativeint * Android.Runtime.JniHandleOwnership -> 'T (requires 'T : null and 'T :> Android.Runtime.IJavaObject)

Type Parameters

T

Parameters

jnienv
IntPtr

nativeint

handle
IntPtr

nativeint

Returns

T

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

GetObject<T>(IntPtr, JniHandleOwnership)

Wraps a JNI object reference into a fully typed IJavaObject implementation.

public static T? GetObject<T> (IntPtr handle, Android.Runtime.JniHandleOwnership transfer) where T : class, Android.Runtime.IJavaObject;
static member GetObject : nativeint * Android.Runtime.JniHandleOwnership -> 'T (requires 'T : null and 'T :> Android.Runtime.IJavaObject)

Type Parameters

T

The type of the object to return. This type must be a reference type and implement the IJavaObject interface.

Parameters

handle
IntPtr

nativeint

A IntPtr containing a Java Native Interface (JNI) object reference.

Returns

T

A T instance which references that Android object instance handle.

Exceptions

handle is not of the appropriate type, as determied by M:Android.Runtime.JNIEnv.IsInstanceOf.

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