I am using the old version of Android PullToRefresh library. It works fine for triggering loading when over scrolling.
However, I want to show the loading footer view when I first enter my activity. I tried many times but still cannot find a correct way.
Is there anybody could help me out?
Set PullToRefreshListView mode:
<com.handmark.pulltorefresh.library.PullToRefreshListView
ptr:ptrMode="pullFromEnd"
ptr:ptrAnimationStyle="rotate"
/>
call
getRefreshableListView().setRefreshing();
where getRefreshableListView() is your method that finds actual PullToRefreshListView. After initial loading of your data don't forget to call
getRefreshableListView().onRefreshComplete();
if setRefreshing() does not work, try using postDelayed():
getRefreshableListView().postDelayed(new Runnable() { getRefreshableListView().setRefreshing();}, 200);
try to set it to show footer with a delay of 300-500 millis,sometimes it doesn't have enough time to initialise
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
mPullRefreshGridView.setRefreshing(true);
}
}, 500);
this solved the problem to me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With