我遇到了滑动刷新布局的问题,如果当时滑动刷新我的布局,如果我按下后退按钮,它将关闭所有活动和片段。。我检查了日志,但没有"应用程序终止"错误。。。
您可以使用isRefreshing()
SwipeRefreshWidget
是否主动显示刷新进度。
样本代码
@Override
public void onBackPressed() {
if (swipeRefreshLayout.isRefreshing()){
// swipeRefreshLayout is Refreshing
}else {
// swipeRefreshLayout is not Refreshing call super.onBackPressed();
super.onBackPressed();
}
}