Example usage for android.os Bundle putBoolean

List of usage examples for android.os Bundle putBoolean

Introduction

In this page you can find the example usage for android.os Bundle putBoolean.

Prototype

public void putBoolean(@Nullable String key, boolean value) 

Source Link

Document

Inserts a Boolean value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:android.support.v17.leanback.widget.GuidedAction.java

/**
 * Save action into a bundle using a given key. When isAutoRestoreEna() is true:
 * <li>{@link #isEditable()} is true: save text of {@link #getTitle()}</li>
 * <li>{@link #isDescriptionEditable()} is true: save text of {@link #getDescription()}</li>
 * <li>{@link #getCheckSetId()} is not {@link #NO_CHECK_SET}: save {@link #isChecked()}}</li>
 * <li>{@link GuidedDatePickerAction} will be saved</li>
 * Subclass may override this method./*from  ww w .  ja v  a 2  s  .c  o  m*/
 * @param bundle  Bundle to save the Action.
 * @param key Key used to save the Action.
 */
public void onSaveInstanceState(Bundle bundle, String key) {
    if (needAutoSaveTitle() && getTitle() != null) {
        bundle.putString(key, getTitle().toString());
    } else if (needAutoSaveDescription() && getDescription() != null) {
        bundle.putString(key, getDescription().toString());
    } else if (getCheckSetId() != NO_CHECK_SET) {
        bundle.putBoolean(key, isChecked());
    }
}

From source file:se.leap.bitmaskclient.ProviderAPI.java

private Bundle downloadCACert() {
    Bundle result = new Bundle();
    try {//from w  ww  .j a v  a2  s.  co  m
        JSONObject provider_json = new JSONObject(preferences.getString(Provider.KEY, ""));
        String ca_cert_url = provider_json.getString(Provider.CA_CERT_URI);
        String cert_string = downloadWithCommercialCA(ca_cert_url);
        result.putBoolean(RESULT_KEY, true);

        if (validCertificate(cert_string) && go_ahead) {
            preferences.edit().putString(Provider.CA_CERT, cert_string).commit();
            result.putBoolean(RESULT_KEY, true);
        } else {
            String reason_to_fail = pickErrorMessage(cert_string);
            result.putString(ERRORS, reason_to_fail);
            result.putBoolean(RESULT_KEY, false);
        }
    } catch (JSONException e) {
        String reason_to_fail = formatErrorMessage(R.string.malformed_url);
        result.putString(ERRORS, reason_to_fail);
        result.putBoolean(RESULT_KEY, false);
    }

    return result;
}

From source file:com.eutectoid.dosomething.picker.PickerFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    saveSettingsToBundle(outState);/*w w w . ja v a2  s  . c o  m*/
    selectionStrategy.saveSelectionToBundle(outState, SELECTION_BUNDLE_KEY);
    if (activityCircle != null) {
        outState.putBoolean(ACTIVITY_CIRCLE_SHOW_KEY, activityCircle.getVisibility() == View.VISIBLE);
    }
}

From source file:com.transistorsoft.cordova.bggeo.CDVBackgroundGeolocation.java

private void changePace(CallbackContext callbackContext, JSONArray data) throws JSONException {
    paceChangeCallback = callbackContext;
    Bundle event = new Bundle();
    event.putString("name", BackgroundGeolocationService.ACTION_CHANGE_PACE);
    event.putBoolean("request", true);
    event.putBoolean("isMoving", data.getBoolean(0));
    postEvent(event);//w  w w  .  j  a va 2 s  . c o  m
}

From source file:com.transistorsoft.cordova.bggeo.CDVBackgroundGeolocation.java

private void getGeofences(CallbackContext callbackContext) {
    getGeofencesCallback = callbackContext;
    Bundle event = new Bundle();
    event.putString("name", BackgroundGeolocationService.ACTION_GET_GEOFENCES);
    event.putBoolean("request", true);
    postEventInBackground(event);// w w  w.j  av  a 2s.  co m
}

From source file:com.transistorsoft.cordova.bggeo.CDVBackgroundGeolocation.java

private void getCount(CallbackContext callbackContext) {
    final Bundle event = new Bundle();
    event.putString("name", BackgroundGeolocationService.ACTION_GET_COUNT);
    event.putBoolean("request", true);
    getCountCallbacks.add(callbackContext);
    postEventInBackground(event);//from  ww w .j  a va2  s. c  o  m
}

From source file:com.transistorsoft.cordova.bggeo.CDVBackgroundGeolocation.java

private void getLocations(CallbackContext callbackContext) {
    final Bundle event = new Bundle();
    event.putString("name", BackgroundGeolocationService.ACTION_GET_LOCATIONS);
    event.putBoolean("request", true);
    getLocationsCallback = callbackContext;
    postEventInBackground(event);/* ww  w . j  a v a2s  . c om*/
}

From source file:com.transistorsoft.cordova.bggeo.CDVBackgroundGeolocation.java

private void clearDatabase(CallbackContext callbackContext) {
    final Bundle event = new Bundle();
    event.putString("name", BackgroundGeolocationService.ACTION_CLEAR_DATABASE);
    event.putBoolean("request", true);
    postEventInBackground(event);/*from ww  w  .  ja va2 s  .c om*/
    callbackContext.success();
}

From source file:com.transistorsoft.cordova.bggeo.CDVBackgroundGeolocation.java

private Boolean removeGeofence(String identifier) {
    final Bundle event = new Bundle();
    event.putString("name", BackgroundGeolocationService.ACTION_REMOVE_GEOFENCE);
    event.putBoolean("request", true);
    event.putString("identifier", identifier);
    postEvent(event);/*w  ww  .jav a 2  s .  co  m*/
    return true;
}

From source file:com.transistorsoft.cordova.bggeo.CDVBackgroundGeolocation.java

private Boolean removeGeofences() {
    final Bundle event = new Bundle();
    event.putString("name", BackgroundGeolocationService.ACTION_REMOVE_GEOFENCES);
    event.putBoolean("request", true);
    postEvent(event);// w w w  . j a v a2  s  .  c o m
    return true;
}