JNIEnv.NewObject 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 |
|---|---|
| NewObject(IntPtr, IntPtr) |
Creates a Java object and calls its parameterless constructor. |
| NewObject(IntPtr, IntPtr, JValue*) |
Creates a Java object and calls its constructor with the supplied arguments. |
| NewObject(IntPtr, IntPtr, JValue[]) |
Creates a Java object and calls its constructor with the supplied arguments. |
NewObject(IntPtr, IntPtr)
Creates a Java object and calls its parameterless constructor.
public static IntPtr NewObject(IntPtr jclass, IntPtr jmethod);
static member NewObject : nativeint * nativeint -> nativeint
Parameters
- jclass
-
IntPtr
nativeint
A live JNI class reference from the current VM, usable on the calling thread until the call returns or throws.
- jmethod
-
IntPtr
nativeint
A live constructor ID for jclass with the JNI signature ()V.
Returns
nativeint
A local JNI reference, or Zero if no reference is obtained. A nonzero local reference is valid only on its creating thread and may be released with DeleteLocalRef(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
NewObject(IntPtr, IntPtr, JValue*)
Creates a Java object and calls its constructor with the supplied arguments.
public static IntPtr NewObject(IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue* parms);
static member NewObject : nativeint * nativeint * nativeptr<Android.Runtime.JValue> -> nativeint
Parameters
- jclass
-
IntPtr
nativeint
A live JNI class reference from the current VM, usable on the calling thread until the call returns or throws.
- jmethod
-
IntPtr
nativeint
A live constructor ID for jclass whose JNI signature returns void and matches the supplied arguments.
- parms
- JValue*
A pointer to the constructor arguments in JNI order and types. Its storage must be readable for the argument count. Do not change the storage during the call, and keep referenced objects live.
Returns
nativeint
A local JNI reference, or Zero if no reference is obtained. A nonzero local reference is valid only on its creating thread and may be released with DeleteLocalRef(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
NewObject(IntPtr, IntPtr, JValue[])
Creates a Java object and calls its constructor with the supplied arguments.
public static IntPtr NewObject(IntPtr jclass, IntPtr jmethod, params Android.Runtime.JValue[] parms);
static member NewObject : nativeint * nativeint * Android.Runtime.JValue[] -> nativeint
Parameters
- jclass
-
IntPtr
nativeint
A live JNI class reference from the current VM, usable on the calling thread until the call returns or throws.
- jmethod
-
IntPtr
nativeint
A live constructor ID for jclass whose JNI signature returns void and matches the supplied arguments.
- parms
- JValue[]
All constructor arguments in JNI order and types. Do not change the array during the call, and keep referenced objects live.
Returns
nativeint
A local JNI reference, or Zero if no reference is obtained. A nonzero local reference is valid only on its creating thread and may be released with DeleteLocalRef(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.