我现在是使用onScrollListener滚动事件进行分页显示。可是这样永远都达不到我要的效果。我想界面显示5条就从数据库取0-5条。这样取。可惜没思路。请教高手帮忙分析。
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();
 }
}

}