共用方式為


SparseIntArray.SetValueAt(Int32, Int32) Method

Definition

Directly set the value at a particular index.

[Android.Runtime.Register("setValueAt", "(II)V", "GetSetValueAt_IIHandler", ApiSince=29)]
public virtual void SetValueAt (int index, int value);
[<Android.Runtime.Register("setValueAt", "(II)V", "GetSetValueAt_IIHandler", ApiSince=29)>]
abstract member SetValueAt : int * int -> unit
override this.SetValueAt : int * int -> unit

Parameters

index
Int32
value
Int32
Attributes

Remarks

Directly set the value at a particular index.

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.SparseIntArray.setValueAt(int, int).

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