Java Code Examples for android.os.Bundle.getBooleanArray()

The following are Jave code examples for showing how to use getBooleanArray() of the android.os.Bundle class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: TreasureHunting   File: MapsActivity.java   View Source Code Vote up 6 votes
private void loadState(Bundle savedInstanceState) {
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
    mLanguage = "en";

    mAudioPlaybackController = new AudioPlaybackController(mLanguage, mCurrentGame);

    if (savedInstanceState == null)
        return;

    boolean[] passed = savedInstanceState.getBooleanArray(getString(R.string.audio_point_state));
    if (passed != null) {
        int i = 0;
        for (AudioPoint p : mCurrentGame.getAudioPoints())
            mAudioPlaybackController.markAudioPoint(p.Number, passed[i++]);
    }
    mLastActiveMarker = savedInstanceState.getInt(getString(R.string.last_active_marker));
}
 
Example 2
Project: ePills   File: AddPillSetTime.java   View Source Code Vote up 6 votes
@Override
public void onRestoreInstanceState(Bundle state) {
    boolean[] weekstate = state.getBooleanArray(STATE_WEEK);
    for (int i = 0; i < weekstate.length; i++) {
        LinearLayout day = getDayLayout(i);
        day.setTag(weekstate[i]);
    }

    if (singleSelected) {
        disableDays();
    } else {
        enableDays();
    }

    super.onRestoreInstanceState(state);
}
 
Example 3
Project: Phoenix-for-VK   File: FavePhotoPagerPresenter.java   View Source Code Vote up 5 votes
public FavePhotoPagerPresenter(@NonNull ArrayList<Photo> photos, int index, int accountId, @Nullable Bundle savedInstanceState) {
    super(photos, accountId, savedInstanceState);
    this.refreshing = new boolean[photos.size()];

    if (savedInstanceState == null) {
        mUpdated = new boolean[photos.size()];
        setCurrentIndex(index);
        refresh(index);
    } else {
        mUpdated = savedInstanceState.getBooleanArray(SAVE_UPDATED);
    }
}
 
Example 4
Project: RxPermission   File: ShadowActivity.java   View Source Code Vote up 5 votes
@Override protected void onCreate(final Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  if (savedInstanceState == null) {
    handleIntent(getIntent());
  } else {
    shouldShowRequestPermissionRationale = savedInstanceState.getBooleanArray(SAVE_RATIONALE);
  }
}
 
Example 5
Project: GitHub   File: Injector.java   View Source Code Vote up 4 votes
public boolean[] getBooleanArray(Bundle state, String key) {
    return state.getBooleanArray(key + baseKey);
}
 
Example 6
Project: android-state   File: InjectionHelper.java   View Source Code Vote up 4 votes
public boolean[] getBooleanArray(Bundle state, String key) {
    return state.getBooleanArray(key + mBaseKey);
}
 
Example 7
Project: pedidos-app   File: ExpandableRecyclerViewAdapter.java   View Source Code Vote up 3 votes
/**
 * Fetches the expandable state map from the saved instance state {@link Bundle}
 * and restores the expanded states of all of the list items.
 * <p>
 * Should be called from {@link Activity#onRestoreInstanceState(Bundle)}  in
 * the {@link Activity} that hosts the RecyclerView that this
 * {@link ExpandableRecyclerViewAdapter} is attached to.
 * <p>
 *
 * @param savedInstanceState The {@code Bundle} from which the expanded
 * state map is loaded
 */
public void onRestoreInstanceState(Bundle savedInstanceState) {
  if (savedInstanceState == null || !savedInstanceState.containsKey(EXPAND_STATE_MAP)) {
    return;
  }
  expandableList.expandedGroupIndexes = savedInstanceState.getBooleanArray(EXPAND_STATE_MAP);
  notifyDataSetChanged();
}