コード例 #1
0
  @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;
  }
コード例 #2
0
 @Override
 public void showError() {
   mAdapter.setResource(new ArrayList<Resource>());
 }
コード例 #3
0
 @Override
 public void showResources(List<Resource> resources) {
   mAdapter.setResource(resources);
 }