listView.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
} @Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (firstVisibleItem == 0) {
Toast.makeText(MyActivity.this, "滑到顶部",1).show();
}
if (visibleItemCount + firstVisibleItem == totalItemCount) {
Toast.makeText(MyActivity.this, "滑到底部",1).show();
}
}
});
04-26 03:23