Code example for AbsListView

Methods: getCount, setSelection

0
            } 
        } 
    } 
 
	private void scrollTo(float position) {
		int count = mList.getCount();
		mScrollCompleted = false;
		final Object[] sections = mSections;
		int sectionIndex;
 
		int index = (int) (position * count);
		if (mList instanceof ListView) { // This INCLUDES ExpandableListView
			((ListView) mList).setSelectionFromTop(index + mListOffset, 0);
		} else { 
			mList.setSelection(index + mListOffset);
		} 
		if (mSectionIndexerV2 != null) {
			mSectionTextV2 = mSectionIndexerV2.getSectionTextForPosition(index);
		} else { 
			if (sections != null && sections.length > 1) {
				sectionIndex = mSectionIndexerV1.getSectionForPosition(index);