Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

AndroidJNIHelper.GetMethodID

static function GetMethodID(javaClass: IntPtr, methodName: string, signature: string = "", isStatic: bool = false): IntPtr;
static IntPtr GetMethodID(IntPtr javaClass, string methodName, string signature = "", bool isStatic = false);
static def GetMethodID(javaClass as IntPtr, methodName as string, signature as string = "", isStatic as bool = false) as IntPtr

Parameters

javaClassRaw JNI Java class object (obtained by calling AndroidJNI.FindClass).
methodNameName of the method as declared in Java.
signatureMethod signature (e.g. obtained by calling AndroidJNIHelper.GetSignature).
isStaticSet to true for static methods; false for instance (nonstatic) methods.

Description

Scans a particular Java class for a method matching a name and a signature.

The signature comparison is done to allow sub-/base-classes of a class types. If no signature is provided the first method with the correct name will be returned.

See Also: AndroidJNIHelper.GetSignature, AndroidJNIHelper.GetConstructorID, AndroidJNIHelper.GetFieldID.

static function GetMethodID(jclass: IntPtr, methodName: string, args: object[], isStatic: bool): IntPtr;
static IntPtr GetMethodID(IntPtr jclass, string methodName, object[] args, bool isStatic);
static def GetMethodID(jclass as IntPtr, methodName as string, args as object[], isStatic as bool) as IntPtr

Parameters

javaClassRaw JNI Java class object (obtained by calling AndroidJNI.FindClass).
methodNameName of the method as declared in Java.
argsArray with parameters to be passed to the method when invoked.
isStaticSet to true for static methods; false for instance (nonstatic) methods.

Description

Get a JNI method ID based on calling arguments.

Generic parameter represents the method return type, and the regular method assumes 'void' return type. Scans a particular Java class for a method matching a signature based on passed arguments. The signature comparison is done to allow for sub-/base-classes of the class types.

static function GetMethodID(jclass: IntPtr, methodName: string, args: object[], isStatic: bool): IntPtr;
static IntPtr GetMethodID(IntPtr jclass, string methodName, object[] args, bool isStatic);
static def GetMethodID(jclass as IntPtr, methodName as string, args as object[], isStatic as bool) as IntPtr

Parameters

javaClassRaw JNI Java class object (obtained by calling AndroidJNI.FindClass).
methodNameName of the method as declared in Java.
argsArray with parameters to be passed to the method when invoked.
isStaticSet to true for static methods; false for instance (nonstatic) methods.

Description

Get a JNI method ID based on calling arguments.

Generic parameter represents the method return type, and the regular method assumes 'void' return type. Scans a particular Java class for a method matching a signature based on passed arguments. The signature comparison is done to allow for sub-/base-classes of the class types.