Språk

SparseArray<E>.SetValueAt(Int32, E) Method

Definition

Given an index in the range 0...size()-1, sets a new value for the indexth key-value mapping that this SparseArray stores.

[Android.Runtime.Register("setValueAt", "(ILjava/lang/Object;)V", "")]
public virtual void SetValueAt(int index, E value);
[<Android.Runtime.Register("setValueAt", "(ILjava/lang/Object;)V", "")>]
override this.SetValueAt : int * 'E -> unit

Parameters

index
Int32
value
E
Attributes

Remarks

Given an index in the range 0...size()-1, sets a new value for the indexth key-value mapping that this SparseArray stores.

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

Android reference for android.util.SparseArray.setValueAt.

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