Version: 2022.2

AndroidJavaObjectConstructor

切换到手册
public AndroidJavaObject (string className, params object[] args);

参数

className 指定 Java 类名称(例如,"java.lang.String" or "java/lang/String")。
args 传递给构造函数的参数数组。

描述

基于类名称构造一个 AndroidJavaObject。

这在本质上是指查找类的类型、分配对象并运行指定的构造函数。


public AndroidJavaObject (IntPtr jobject);

参数

jobject A reference to existing Java object.

描述

Create AndroidJavaObject for existing Java object.

Does not take ownership of passed reference, you still have to delete it.


public AndroidJavaObject (IntPtr clazz, IntPtr constructorID, params object[] args);

参数

clazz A pointer to Java class.
constructorID A method ID for the constructor to be used.
args 传递给构造函数的参数数组。

描述

Create AndroidJavaObject (and it's Java counterpart) using given Java class and constructor.