ArrayMap.SetValueAt(Int32, Object) Method

Definition

Set the value at a given index in the array.

[Android.Runtime.Register("setValueAt", "(ILjava/lang/Object;)Ljava/lang/Object;", "")]
public Java.Lang.Object? SetValueAt (int index, Java.Lang.Object? value);
[<Android.Runtime.Register("setValueAt", "(ILjava/lang/Object;)Ljava/lang/Object;", "")>]
member this.SetValueAt : int * Java.Lang.Object -> Java.Lang.Object

Parameters

index
Int32

The desired index, must be between 0 and #size()-1.

value
Object

The new value to store at this index.

Returns

Returns the previous value at the given index.

Attributes

Remarks

Set the value at a given index in the array.

For indices outside of the range 0...size()-1, the behavior is undefined for apps targeting android.os.Build.VERSION_CODES#P and earlier, and an ArrayIndexOutOfBoundsException is thrown for apps targeting android.os.Build.VERSION_CODES#Q and later.

Java documentation for android.util.ArrayMap.setValueAt(int, V).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to