Invoke
Called by the java vm whenever a method is invoked on the java proxy interface. You can override this to run special code on method invocation, or you can leave the implementation as is, and leave the default behavior which is to look for c# methods matching the signature of the java method.
Read time 2 minutesLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.AndroidJNIModule
Invoke(string, Object[])
Called by the java vm whenever a method is invoked on the java proxy interface. You can override this to run special code on method invocation, or you can leave the implementation as is, and leave the default behavior which is to look for c# methods matching the signature of the java method.
public virtual AndroidJavaObject Invoke(string methodName, object[] args)
Parameters
Returns
Type | Description |
|---|---|
| AndroidJavaObject |
Invoke(string, AndroidJavaObject[])
Called by the java vm whenever a method is invoked on the java proxy interface. You can override this to run special code on method invocation, or you can leave the implementation as is, and leave the default behavior which is to look for c# methods matching the signature of the java method.
public virtual AndroidJavaObject Invoke(string methodName, AndroidJavaObject[] javaArgs)
Parameters
Name of the invoked java method.
Arguments passed from the java vm - all objects are represented by AndroidJavaObject, int for instance is represented by a java.lang.Integer object.
Returns
Type | Description |
|---|---|
| AndroidJavaObject |
Invoke(string, IntPtr)
Called by the java vm whenever a method is invoked on the java proxy interface. You can override this to run special code on method invocation, or you can leave the implementation as is, which will convert argument array to AndroidJavaObject[] and call other Invoke.
public virtual nint Invoke(string methodName, nint javaArgs)
Parameters
Returns
Type | Description |
|---|---|
| IntPtr | A local reference to Java object, representing the return value. |