# CallObjectMethod

> Calls a Java instance method defined by \<tt\>methodID\</tt\>, optionally passing an array of arguments (\<tt\>args\</tt\>) to the method.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AndroidJNIModule

## CallObjectMethod(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.

```csharp
public static IntPtr CallObjectMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): **** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): **** (jvalue\[]):&#x20;

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) |             |

### Remarks

This method returns a reference to a \\\<tt\\>java.lang.Object\\\</tt\\>, or a subclass thereof.

Additional Resources: [Java Native Interface Specification (Oracle)](http://download.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html)

## CallObjectMethod(IntPtr, IntPtr, Span\<jvalue>)

Calls a Java instance method defined by \\\<tt\\>methodID\\\</tt\\>, optionally passing an array of arguments (\\\<tt\\>args\\\</tt\\>) to the method.

```csharp
public static IntPtr CallObjectMethod(IntPtr obj, IntPtr methodID, Span<jvalue> args)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): **** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): **** (\[Span\<jvalue>]\(https\://learn.microsoft.com/dotnet/api/system.span-1)):&#x20;

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [IntPtr](https://learn.microsoft.com/dotnet/api/system.intptr) |             |

### Remarks

This method returns a reference to a \\\<tt\\>java.lang.Object\\\</tt\\>, or a subclass thereof.

Additional Resources: [Java Native Interface Specification (Oracle)](http://download.oracle.com/javase/1.5.0/docs/guide/jni/spec/jniTOC.html)
