AlphabetIndexer.GetPositionForSection(Int32) Method

Definition

Performs a binary search or cache lookup to find the first row that matches a given section's starting letter.

[Android.Runtime.Register("getPositionForSection", "(I)I", "GetGetPositionForSection_IHandler")]
public virtual int GetPositionForSection (int sectionIndex);
[<Android.Runtime.Register("getPositionForSection", "(I)I", "GetGetPositionForSection_IHandler")>]
abstract member GetPositionForSection : int -> int
override this.GetPositionForSection : int -> int

Parameters

sectionIndex
Int32

the section to search for

Returns

the row index of the first occurrence, or the nearest next letter. For instance, if searching for "T" and no "T" is found, then the first row starting with "U" or any higher letter is returned. If there is no data following "T" at all, then the list size is returned.

Implements

Attributes

Remarks

Performs a binary search or cache lookup to find the first row that matches a given section's starting letter.

Java documentation for android.widget.AlphabetIndexer.getPositionForSection(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