Language

JNIEnv.IsInstanceOf(IntPtr, IntPtr) Method

Definition

Tests whether a Java object can be cast to a specified class.

public static bool IsInstanceOf(IntPtr obj, IntPtr clazz);
static member IsInstanceOf : nativeint * nativeint -> bool

Parameters

obj
IntPtr

nativeint

A live, non-null JNI object reference from the current VM, usable on the calling thread until the call returns or throws. The managed wrapper rejects Zero.

clazz
IntPtr

nativeint

A live, non-null JNI class reference from the current VM, usable on the calling thread until the call returns or throws.

Returns

true if the object can be cast to clazz; otherwise, false.

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