Udostępnij za pośrednictwem


LongSparseArray.ValueAt(Int32) Method

Definition

Given an index in the range 0...size()-1, returns the value from the indexth key-value mapping that this LongSparseArray stores.

[Android.Runtime.Register("valueAt", "(I)Ljava/lang/Object;", "GetValueAt_IHandler")]
public virtual Java.Lang.Object? ValueAt (int index);
[<Android.Runtime.Register("valueAt", "(I)Ljava/lang/Object;", "GetValueAt_IHandler")>]
abstract member ValueAt : int -> Java.Lang.Object
override this.ValueAt : int -> Java.Lang.Object

Parameters

index
Int32

Returns

Attributes

Remarks

Given an index in the range 0...size()-1, returns the value from the indexth key-value mapping that this LongSparseArray stores.

The values corresponding to indices in ascending order are guaranteed to be associated with keys in ascending order, e.g., valueAt(0) will return the value associated with the smallest key and valueAt(size()-1) will return the value associated with the largest key.

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.LongSparseArray.valueAt(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