Here's Erik Wallentinsen's PullToRefresh
ListView on github.
But it refreshes the listview from top only:
I want to change this, and refresh the listview when it gets pulled from bottom.
Apparently, it is needed to change this source .
Maybe somebody already had this issue and solved it?
I recommend you use chrisbanes 's library: https://github.com/chrisbanes/Android-PullToRefresh which supports listview, gridview, scrollview, webview ... Here is an start guide
To refresh listview from bottom, just set mode for it. Here is an example that I tried:
PullToRefreshListView mPullRefreshListView =
(PullToRefreshListView) findViewById(R.id.listview);
mPullRefreshListView.setMode(Mode.BOTH); // mode refresh for top and bottom
mPullRefreshListView.setShowIndicator(false); //disable indicator
mPullRefreshListView.setPullLabel("Loading");
mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
//do something when refresh
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.