Android:Problem about ListView OnScrollListener
everyone I have a problem about getting Data when I scroll the ListView. My code is here:
public void onScrollStateChanged(AbsListView view, int scrollState) {
// TODO Auto-generated method stub
switch(scrollState){
case OnScrollListener.SCROLL_STATE_IDLE:{
/*Show which num is picked */
/*
if(view.getChildCount()>=5){
mBusy = false;
int firstPos = view.getFirstVisiblePosition();
int pos = firstPos+1;
mShowBtn.setText(((TextView)view.getChildAt(pos)).getText());
}
*/
break;
}
case OnScrollListener.SCROLL_STATE_FLING:
case OnScrollListener.SCROLL开发者_开发问答_STATE_TOUCH_SCROLL:
mBusy = true;
break;
}
}
Note:The code in the quote in the SCROLL_STATE_IDLE case is wrong. Why? And how can I get the state that there are enough items already "exist" and I can operate them ?
Thanks a lot first!@o@
精彩评论