Reputation: 14844
I am trying to use https://github.com/chrisbanes/ActionBar-PullToRefresh to implement pull-to-refresh. But I don't see where in the example to get data from my server. I am using observer pattern so that inside the update
method I can call
mPullToRefresh.setRefreshComplete();
But where do I make the call to server?
By Observer pattern I mean that there is a class SynchDogs responsible for pulling from server. Then this Listview activity registers with SynchDogs as an observer. So where in the Pull-to-refresh pattern to I tell SynchDogs to synch with server? I am using the quick guide as
private void setupPullToRefresh() {
ActionBarPullToRefresh.from(this)
.theseChildrenArePullable(R.id.dog_list)
.listener(this)
.setup(mPullToRefresh);
}
Upvotes: 1
Views: 217
Reputation: 39519
you start in the pull-to-refresh listener and then stop via setRefreshComplete when your job is finished
PS: better not use this lib any more https://plus.google.com/103829716466878605055/posts/8wmKAXEGAG2 there is now a SwipeRefreshLayout in the official lib
Upvotes: 2