android listView 滚动加载

1.When the scrolling is stop(idle) to invoke our operation

listViewLocal.setOnScrollListener(new OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
if (scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
if (view.getLastVisiblePosition() == view.getCount() - 1) {
mFromIndex += mRows;
getData();
}
}
}

@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {

}
});

你可能感兴趣的:(android listView 滚动加载)