Version: 2022.2
public AndroidJavaObject Invoke (string methodName, object[] args);
public AndroidJavaObject Invoke (string methodName, AndroidJavaObject[] javaArgs);

参数

methodName 调用的 Java 方法的名称。
args 从 java vm 传递的参数 - 转换为 AndroidJavaObject、AndroidJavaClass 或原始对象。
javaArgs 从 java vm 传递的参数 - 所有对象均用 AndroidJavaObject 表示,实例的 int 用 java.lang.Integer 对象表示。

描述

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 IntPtr Invoke (string methodName, IntPtr javaArgs);

参数

methodName 调用的 Java 方法的名称。
javaArgs A reference to Java object array with arguments passed to this method.

返回

IntPtr A local reference to Java object, representing the return value.

描述

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.