Skip to content

Instantly share code, notes, and snippets.

@brucetoo
Created July 21, 2015 03:43
Show Gist options
  • Save brucetoo/a9e105c822a411149145 to your computer and use it in GitHub Desktop.
Save brucetoo/a9e105c822a411149145 to your computer and use it in GitHub Desktop.
PullToRefresh自动刷新
@Override
public void onResume() {
super.onResume();
//自动刷新值需要在onResume方法中延迟执行 mPulltoRefreshView.setRefreshing(true)
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
mGridView.setRefreshing(true);
//异步执行加载数据任务
//加载数据成功后,必须调用 mPullToRefreshView.onRefreshComplete()
}
}, 500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment