Language

JniRuntime.JniValueManager.GetPeer(JniObjectReference, Type) Method

Definition

Reuses a compatible mapped peer or creates one with Copy transfer options.

public Java.Interop.IJavaPeerable? GetPeer(Java.Interop.JniObjectReference reference, Type? targetType = default);
member this.GetPeer : Java.Interop.JniObjectReference * Type -> Java.Interop.IJavaPeerable

Parameters

reference
JniObjectReference

The Java object reference to wrap or look up.

targetType
Type

The optional managed peer type required for a reused mapping.

Returns

A compatible existing or created peer, or null for a zero reference or incompatible conversion.

Remarks

The source reference is not consumed by this lookup.

Applies to