Code example for AbsListView

Methods: getChildAt

0
    } 
 
    private OnScrollListener mOnScrollListener = new OnScrollListener() {
        @Override 
        public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { 
            View topChild = view.getChildAt(0); 
            if (topChild == null) { 
                onNewScroll(0); 
            } else if (topChild != mMarginView) { 
                onNewScroll(mHeaderContainer.getHeight()); 
            } else { 
                onNewScroll(-topChild.getTop()); 
            } 
        } 
 
        @Override 
        public void onScrollStateChanged(AbsListView view, int scrollState) { 
        } 
    }; 
    private int mLastScrollPosition;