【发布时间】:2014-03-29 16:58:27
【问题描述】:
我正在尝试使用https://github.com/chrisbanes/ActionBar-PullToRefresh 来实现pull-to-refresh。但是我看不到示例中从我的服务器获取数据的位置。我正在使用观察者模式,以便在 update 方法中可以调用
mPullToRefresh.setRefreshComplete();
但是我在哪里调用服务器呢?
通过观察者模式,我的意思是有一个类 SynchDogs 负责从服务器拉取。然后这个 Listview 活动向 SynchDogs 注册为观察者。那么,在 Pull-to-refresh 模式中我告诉 SynchDogs 与服务器同步的地方是什么?我正在使用快速指南作为
private void setupPullToRefresh() {
ActionBarPullToRefresh.from(this)
.theseChildrenArePullable(R.id.dog_list)
.listener(this)
.setup(mPullToRefresh);
}
【问题讨论】:
标签: android android-layout pull-to-refresh