Language

JNIEnv.FindClass Method

Definition

Overloads

Name Description
FindClass(String, IntPtr)

Gets a cached JNI class reference, creating a global reference if the cache is empty.

FindClass(String)

Finds a Java class by name.

FindClass(Type)

Finds a Java class using a managed type's JNI signature. If no usable reference signature is available, the lookup uses java/lang/Object as its base type.

FindClass(String, IntPtr)

Gets a cached JNI class reference, creating a global reference if the cache is empty.

public static IntPtr FindClass(string className, ref IntPtr cachedJniClassHandle);
static member FindClass : string * nativeint -> nativeint

Parameters

className
String

The Java class name to look up if the cache is empty. The lookup accepts a nonempty JNI or dot-separated name.

cachedJniClassHandle
IntPtr

nativeint

A reference to cache storage containing a live global class reference or Zero. A nonzero value is returned without checking className.

Returns

IntPtr

nativeint

The cached global JNI class reference. Its owner must keep it valid while callers use it and release it when the cache is no longer used.

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

FindClass(String)

Finds a Java class by name.

public static IntPtr FindClass(string classname);
static member FindClass : string -> nativeint

Parameters

classname
String

A nonempty Java class name in JNI slash form or dot-separated form, or an array type descriptor.

Returns

IntPtr

nativeint

A global JNI reference to the class, or Zero if no reference is obtained. The owner must eventually release a nonzero reference, for example with DeleteGlobalRef(IntPtr).

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

FindClass(Type)

Finds a Java class using a managed type's JNI signature. If no usable reference signature is available, the lookup uses java/lang/Object as its base type.

public static IntPtr FindClass(Type type);
static member FindClass : Type -> nativeint

Parameters

type
Type

The non-null managed type whose JNI type signature is used for the lookup.

Returns

IntPtr

nativeint

A global JNI reference to the class, or Zero if no reference is obtained. The owner must eventually release a nonzero reference, for example with DeleteGlobalRef(IntPtr).

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