Taal

JavaObjectExtensions.JavaCast<TResult>(IJavaObject) Method

Definition

Reuses a compatible managed peer or obtains a wrapper of the requested type.

public static TResult? JavaCast<TResult>(this Android.Runtime.IJavaObject? instance) where TResult : class, Android.Runtime.IJavaObject;
static member JavaCast : Android.Runtime.IJavaObject -> 'Result (requires 'Result : null and 'Result :> Android.Runtime.IJavaObject)

Type Parameters

TResult

The reference type implementing IJavaObject to return.

Parameters

instance
IJavaObject

The peer to cast, or null to return null.

Returns

TResult

The original compatible instance or a wrapper of TResult; null for a null input.

Applies to