文档

Unity Engine

Unity Engine

CallStaticStringMethod

Invokes the specified \<tt\>methodID\</tt\> static method on a Java object, optionally passing in an array of arguments (\<tt\>args\</tt\>).
阅读时间1 分钟最后更新于 1 个月前

Definition

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

CallStaticStringMethod(IntPtr, IntPtr, jvalue[])

Invokes the specified \<tt\>methodID\</tt\> static method on a Java object, optionally passing in an array of arguments (\<tt\>args\</tt\>).
public static string CallStaticStringMethod(nint clazz, nint methodID, jvalue[] args)

Parameters

clazz

The Java class on which to call the static 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 CallStaticObjectMethod() with the same parameters, but creates a managed string from the result.
Additional Resources: AndroidJNI.CallStaticObjectMethod

CallStaticStringMethod(IntPtr, IntPtr, Span<jvalue>)

Invokes the specified
methodID
static method on a Java object, optionally passing in an array of arguments (
args
).
public static string CallStaticStringMethod(nint clazz, nint methodID, Span<jvalue> args)

Parameters

clazz

The Java class on which to call the static 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
CallStaticObjectMethod()
with the same parameters, but creates a managed string from the result.
Additional Resources: AndroidJNI.CallStaticObjectMethod