JNIEnv.FindClass Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 |
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 nonempty JNI class name or array type descriptor to look up if the cache is empty. In .NET for Android 11, dot-separated names are converted to JNI form before lookup. In .NET for Android 10, a dot-separated name can abort the process when JNI checks are enabled.
- 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
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 JNI class name, such as java/lang/String, or an array type descriptor. In .NET for Android 11, dot-separated names are converted to JNI form before lookup. In .NET for Android 10, a dot-separated name can abort the process when JNI checks are enabled.
Returns
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
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.