android listView 滚动加载显示

  1. listView.setOnScrollListener(new OnScrollListener(){  
  2.   
  3.         public void onScrollStateChanged(AbsListView view, int scrollState) {  
  4.             //当不滚动时  
  5.             if(scrollState == OnScrollListener.SCROLL_STATE_IDLE){  
  6.                 System.out.println(view.getLastVisiblePosition()+"==="+view.getCount());  
  7.                 //判断滚动到底部   
  8.                 if(view.getLastVisiblePosition()==(view.getCount()-1)){  
  9.                     //然后 经行一些业务操作  
  10.                     pd.show();  
  11.                     mt = new MyThread();  
  12.                     mt.start();  
  13.                 }  
  14.             }  
  15.         }  
  16.         public void onScroll(AbsListView view, int firstVisibleItem,  
  17.                 int visibleItemCount, int totalItemCount) {  
  18.             // TODO Auto-generated method stub  
  19.               
  20.         }  
  21.           
  22.     });  

你可能感兴趣的:(android,ListView)