文档

Unity Engine

Unity Engine

CallStringMethod

Calls a Java instance method defined by \<tt\>methodID\</tt\>, optionally passing an array of arguments (\<tt\>args\</tt\>) to the method.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AndroidJNIModule

CallStringMethod(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 string CallStringMethod(nint obj, nint methodID, jvalue[] args)

Parameters

The Java object on which to call the instance method.

methodID

The ID of the method to call.

args

jvalue[]
An array of arguments to pass to the method.

Returns

Type

Description

stringThe managed string returned by the method.

Remarks

This is a convenience function that calls CallObjectMethod() with the same parameters, but creates a managed string from the result.
Additional Resources: AndroidJNI.CallObjectMethod

CallStringMethod(IntPtr, IntPtr, Span<jvalue>)

Calls a Java instance method defined by
methodID
, optionally passing an array of arguments (
args
) to the method.
public static string CallStringMethod(nint obj, nint methodID, Span<jvalue> args)

Parameters

The Java object on which to call the instance method.

methodID

The ID of the method to call.

An array of arguments to pass to the method.

Returns

Type

Description

stringThe managed string returned by the method.

Remarks

This is a convenience function that calls
CallObjectMethod
with the same parameters, but creates a managed string from the result.
Additional Resources: AndroidJNI.CallObjectMethod