AndroidJavaObject
AndroidJavaObject is the Unity representation of a generic instance of java.lang.Object.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.AndroidJNIModule
- Implements: IDisposable
public class AndroidJavaObject : IDisposable
Remarks
It can be used as type-less interface to an instance of any Java class. Note: this API can be used from custom thread, but requires that thread to be attached to JVM first, see AndroidJNI.AttachCurrentThread.
Constructors
Constructor | Description |
|---|---|
| AndroidJavaObject(System.IntPtr) | Create AndroidJavaObject for existing Java object. |
| AndroidJavaObject(System.IntPtr,System.IntPtr,System.Object[]) | Create AndroidJavaObject (and it's Java counterpart) using given Java class and constructor. |
| AndroidJavaObject(System.String,System.Object[]) | Construct an AndroidJavaObject based on the name of the class. |
| AndroidJavaObject(System.String,System.String[]) | Construct an AndroidJavaObject based on the name of the class. |
| AndroidJavaObject(System.String,UnityEngine.AndroidJavaClass[]) | Construct an AndroidJavaObject based on the name of the class. |
| AndroidJavaObject(System.String,UnityEngine.AndroidJavaObject[]) | Construct an AndroidJavaObject based on the name of the class. |
| AndroidJavaObject(System.String,UnityEngine.AndroidJavaProxy[]) | Construct an AndroidJavaObject based on the name of the class. |
| AndroidJavaObject(System.String,UnityEngine.AndroidJavaRunnable[]) | Construct an AndroidJavaObject based on the name of the class. |
Methods
Method | Description |
|---|---|
| Call | Calls a Java method on an object (non-static). |
| CallStatic | Call a static Java method on a class. |
| CloneReference | Creates a clone of the C# object that references the same Java object. |
| Dispose | IDisposable callback. |
| Get | Get the value of a field in an object (non-static). |
| GetRawClass | Retrieves the raw jclass pointer to the Java class. |
| GetRawObject | Retrieves the raw jobject pointer to the Java object. |
| GetStatic | Get the value of a static field in an object type. |
| Set | Set the value of a field in an object (non-static). |
| SetStatic | Set the value of a static field in an object type. |