开发者

Android:Problem about ListView OnScrollListener

开发者 https://www.devze.com 2023-03-16 03:34 出处:网络
everyone I have a problem about getting Data when I scroll the ListView. My code is here: public void onScrollStateChanged(AbsListView view, int scrollState) {

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@

0

精彩评论

暂无评论...
验证码 换一张
取 消