Code example for ListView

Methods: getHeaderViewsCount, setOnScrollListener

0
     * @param lv - The list view. 
     */ 
 
    public void setListView(ListView lv) {
        mListView = lv;
        mListView.setOnScrollListener(this);
        mListViewHeadersCount = mListView.getHeaderViewsCount();
    } 
 
    /** 
     * Sets an external OnScroll listener. Since the StickyHeaderListView sets 
     * itself as the scroll events listener of the listview, this method allows 
     * the user to register another listener that will be called after this 
     * class listener is called. 
     * 
     * @param listener - The external listener. 
     */ 
    public void setOnScrollListener(ListView.OnScrollListener listener) {
        mListener = listener;
    }