Code example for AbsListView

Methods: getFirstVisiblePosition, getLastVisiblePosition

0
		@Override 
		public void onScrollStateChanged(AbsListView view, int scrollState) {
			if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
				if (refreshableListener != null) {
					try { 
						int last = view.getLastVisiblePosition();
						last = Math.min(last, listView.getCount() - 1 - listView.getFooterViewsCount());
						displaying(view.getFirstVisiblePosition(), last);
					} catch (Exception e) {
						Log.e(tag, "invoke scroll idle event failed", e);
					} 
				} 
			} 
		} 
 
		@Override 
		public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
		} 
 
	}