@Override protected void onRestoreInstanceState(Parcelable state) { if (!(state instanceof SavedState)) { super.onRestoreInstanceState(state); return; } SavedState ss = (SavedState) state; super.onRestoreInstanceState(ss.getSuperState()); mAdapter.setResource(ss.resources); if (ss.loading) { mAdapter.showLoading(); } swipeRefreshLayout.setRefreshing(ss.refreshing); message.setText(ss.message); mInited = true; }
@Override public void showError() { mAdapter.setResource(new ArrayList<Resource>()); }
@Override public void showResources(List<Resource> resources) { mAdapter.setResource(resources); }