Code example for AbsListView

Methods: getFirstVisiblePosition

0
				case OnScrollListener.SCROLL_STATE_IDLE:
					if (isScrolling) {
						View item = getChildAt(0);
						 
						if (Math.abs(item.getTop()) >= Math.abs(item.getBottom())) {
							setSelection(view.getFirstVisiblePosition() + mCellsPerRow);
						} else { 
							setSelection(view.getFirstVisiblePosition());
						} 
					} 
					 
					isScrolling = false;
					break; 
				case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:
				case OnScrollListener.SCROLL_STATE_FLING:
					isScrolling = true;
					break; 
				} 
			} 
			 
			@Override