This is what I used to load more data at the end of the list.
listview.setOnScrollListener(new OnScrollListener(){ @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { //Algorithm to check if the last item is visible or not final int lastItem = firstVisibleItem + visibleItemCount; if(lastItem == totalItemCount){ // you have reached end of list, load more data } } @Override public void onScrollStateChanged(AbsListView view,int scrollState) { //blank, not using this } });
Akshat Agarwal Oct. 16 '13 at 19:13 2013-10-16 19:13
source share