SuperListview
SuperListview copied to clipboard
endless `onMoreAsked` callback?
Your sample app is pretty good except that no onMoreAsked
called. So I import your lib in my project and create a fragment like this, but when I scroll down to the bottom, endless "More asked, more served"
were created!
What' more, I rebuilt your sample project, I got the same result.
Why it calls endless onMoreAsked
method? Is it a bug? how do i do?
I am facing similar problem when I am using this with GridView, with listview is working, its strange!!!
@oneenam Hi, I solved my problem by using android-pull-to-refresh instead. You can try it.
en, In the newest android 5 sdk version 21, it will load more for ever, so there are something is wrong. I think when add some data, we should set isLoadingMore = false; like sample code bellow, so the library design scheme should be changed.
public void onLoadMore() {
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
try {
Thread.sleep(1000); //sleep 1 seconds
} catch (InterruptedException e) {
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void result) {
if (adapter.count <45) {
adapter.count += 15;
adapter.notifyDataSetChanged();
swipeLayout.setRefreshing(false);
listView.setCanLoadMore(adapter.count < 45);
listView.onLoadMoreComplete();
super.onPostExecute(result);
}
else
swipeLayout.setRefreshing(false);
}
}.execute();
}
In my case, works for the first time I reach the Listview bottom, but not anymore and I don't understand why...