# SetBooleanArrayElement

> Sets the boolean value of one element in a primitive array.

## Definition

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

## SetBooleanArrayElement(IntPtr, int, byte)

Sets the boolean value of one element in a primitive array.

> **Warning:**
>
> **Deprecated.** AndroidJNI.SetBooleanArrayElement(IntPtr, int, byte) is obsolete. Use AndroidJNI.SetBooleanArrayElement(IntPtr, int, bool) method instead

```csharp
public static void SetBooleanArrayElement(IntPtr array, int index, byte val)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): The array of native booleans.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index of the array element to set.**** (\[byte]\(https\://learn.microsoft.com/dotnet/api/system.byte)): The value to set - for 'true' use 1, for 'false' use 0.

### Remarks

This function is a special case of SetBooleanArrayRegion(), called with region size set to 1.

This overload is obsolete. Use the overload that takes the bool \\\<tt\\>val\\\</tt\\> parameter instead.

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

## SetBooleanArrayElement(IntPtr, int, bool)

Sets the boolean value of one element in a primitive array.

```csharp
public static void SetBooleanArrayElement(IntPtr array, int index, bool val)
```

### Parameters

**** (\[IntPtr]\(https\://learn.microsoft.com/dotnet/api/system.intptr)): The array of native booleans.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Index of the array element to set.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): The value to set.

### Remarks

This function is a special case of SetBooleanArrayRegion(), called with region size set to 1.

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