PagingListView
PagingListView copied to clipboard
If use the setMoreItems without adapter, Exeption
// 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);
Sorry I do not understand, the problem is when you need to add an the listview without adding and adapter?
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)
I will take a look thanks!!