Језик

JavaPeerProxy.CreateInstance(IntPtr, JniHandleOwnership) Method

Definition

Creates an instance of the target type using the JNI handle and ownership semantics. This replaces the reflection-based constructor invocation used in the legacy path.

public abstract Java.Interop.IJavaPeerable? CreateInstance(IntPtr handle, Android.Runtime.JniHandleOwnership transfer);
abstract member CreateInstance : nativeint * Android.Runtime.JniHandleOwnership -> Java.Interop.IJavaPeerable

Parameters

handle
IntPtr

nativeint

The JNI object reference handle.

transfer
JniHandleOwnership

How to handle JNI reference ownership.

Returns

A new instance of the target type wrapping the JNI handle, or null if activation is not supported.

Remarks

Derived proxies supply the activation implementation. The base class declares this method without performing constructor reflection or reference transfer itself.

Applies to