PagingListView icon indicating copy to clipboard operation
PagingListView copied to clipboard

If use the setMoreItems without adapter, Exeption

Open McGars opened this issue 9 years ago • 3 comments

// Try this, 
public void setHasMoreItems(boolean hasMoreItems) {
        this.hasMoreItems = hasMoreItems;
                // on 10 android exeption when call removeFooterView(loadingView)
        if(Build.VERSION.SDK_INT < 11){
            int visible = this.hasMoreItems ? VISIBLE : GONE;
            if(loadingView!=null && loadingView.getVisibility() != visible)
                loadingView.setVisibility(visible);
        } else {
            int footerCount = getFooterViewsCount();
            if(!this.hasMoreItems && footerCount > 0){
                removeFooterView(loadingView);
            } else if (this.hasMoreItems && footerCount == 0) {
                addFooterView(loadingView);
            }
        }
    }

// disable divider on footer view
private void init() {
        ...
                if(Build.VERSION.SDK_INT < 11)
               setFooterDividersEnabled(false);

McGars avatar Apr 28 '15 12:04 McGars

Sorry I do not understand, the problem is when you need to add an the listview without adding and adapter?

nicolasjafelle avatar Apr 28 '15 12:04 nicolasjafelle

Yes, used in library and when to simply display a list without the loader call setHasMoreItems(false) before adding adapter in init section and invoke exeption. And in 10 version androidinvoke null exeption when call removeFooterView(loadingView)

McGars avatar Apr 28 '15 12:04 McGars

I will take a look thanks!!

nicolasjafelle avatar Apr 29 '15 12:04 nicolasjafelle