Language

JNIEnv.NewObject Method

Definition

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

IntPtr

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

IntPtr

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

IntPtr

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