コード例 #1
0
ファイル: GameListFragment.java プロジェクト: exit490/EasyMVP
  /**
   * Saving current games loaded to restore them if the view lifecycle is restarted
   *
   * @param outState with current games loaded parcel
   */
  @Override
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    List<Game> currentGames = gameAdapter.getCurrentGames();

    Parcelable currentGamesParcel = Parcels.wrap(currentGames);
    outState.putParcelable(EXTRA_CURRENT_GAMES_LOADED, currentGamesParcel);
  }