static StatisticsState bundleToStatisticsState()

in todoapp/app/src/main/java/com/example/android/architecture/blueprints/todoapp/statistics/StatisticsStateBundler.java [42:55]


  static StatisticsState bundleToStatisticsState(@Nullable Bundle bundle) {
    if (bundle == null) return StatisticsState.loading();

    if (!bundle.containsKey("statistics")) return StatisticsState.loading();

    bundle = checkNotNull(bundle.getBundle("statistics"));

    if (bundle.containsKey("active_count") && bundle.containsKey("completed_count")) {
      return StatisticsState.loaded(
          bundle.getInt("active_count"), bundle.getInt("completed_count"));
    }

    return StatisticsState.loading();
  }