80,350
社区成员
发帖
与我相关
我的任务
分享
public void onScroll(AbsListView view, int firstVisibleItem,
int visibleItemCount, int totalItemCount) {
lastItem = firstVisibleItem+visibleItemCount;
if(lastItem==totalItemCount){
if(adapter.count<=scenicList.size()){
adapter.count+=4;
adapter.notifyDataSetChanged();
lv_m_scenicList.setSelection(lastItem);
int currentPage=adapter.count/4;
Toast.makeText(getApplicationContext(), "第"+currentPage+"页", Toast.LENGTH_LONG).show();
}
}
//System.out.println("latstItem:"+lastItem);
}
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
if(lastItem == adapter.count && scrollState == OnScrollListener.SCROLL_STATE_IDLE)
{
if(adapter.count<=scenicList.size()){
adapter.count+=4;
System.out.println(adapter.getCount());
adapter.notifyDataSetChanged();
int currentPage=adapter.count/4;
Toast.makeText(getApplicationContext(), "第"+currentPage+"页", Toast.LENGTH_LONG).show();
}
}
}