Java android学生主题刷刷新布局
我正在开发android应用程序,因此,错误是每当我刷起数据时,数据就丢失了。如何在浏览布局后恢复数据? 下面给出的代码是刷卡刷新的代码。 数据来自api(来自服务器)Java android学生主题刷刷新布局,java,android,xml,api,Java,Android,Xml,Api,我正在开发android应用程序,因此,错误是每当我刷起数据时,数据就丢失了。如何在浏览布局后恢复数据? 下面给出的代码是刷卡刷新的代码。 数据来自api(来自服务器) 为什么要调用recyclerView.setVisibility(View.GONE);-->从屏幕上隐藏你的回收视图??!!您需要返回代码,而不是返回一个void。 this.swipeRefreshLayout = view.findViewById(R.id.swipeRefresh); this.swip
为什么要调用recyclerView.setVisibility(View.GONE);-->从屏幕上隐藏你的回收视图??!!您需要返回代码,而不是返回一个void。
this.swipeRefreshLayout = view.findViewById(R.id.swipeRefresh);
this.swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
this.swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
recyclerView.setVisibility(View.GONE);
swipeRefreshLayout.setRefreshing(false);
new SelectData().execute(did,course);
Log.e("logo", course);
}
}, 1000);
}
});