CallObjectMethod
Calls a Java instance method defined by \<tt\>methodID\</tt\>, optionally passing an array of arguments (\<tt\>args\</tt\>) to the method.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.AndroidJNIModule
CallObjectMethod(IntPtr, IntPtr, jvalue[])
Calls a Java instance method defined by \<tt\>methodID\</tt\>, optionally passing an array of arguments (\<tt\>args\</tt\>) to the method.
public static nint CallObjectMethod(nint obj, nint methodID, jvalue[] args)
Parameters
Returns
Type | Description |
|---|---|
| IntPtr | A local reference to the Java object returned by the method. |
Remarks
This method returns a reference to a \<tt\>java.lang.Object\</tt\>, or a subclass thereof.
Additional Resources: Java Native Interface Specification (Oracle)
CallObjectMethod(IntPtr, IntPtr, Span<jvalue>)
Calls a Java instance method defined by , optionally passing an array of arguments () to the method.
methodIDargspublic static nint CallObjectMethod(nint obj, nint methodID, Span<jvalue> args)
Parameters
The Java object on which to call the instance method.
The ID of the method to call.
An array of arguments to pass to the method.
Returns
Type | Description |
|---|---|
| IntPtr | A local reference to the Java object returned by the method. |
Remarks
This method returns a reference to a , or a subclass thereof.
java.lang.ObjectAdditional Resources: Java Native Interface Specification (Oracle)