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:Main.java

public static Bundle addParcelableResentParcelFromSmallParcel(Parcelable parcelable, boolean isResent) {
    Bundle bundle = (Bundle) parcelable;
    bundle.putBoolean(BUNDLE_SMALL_RESENT_PARCEL, isResent);
    return bundle;
}

From source file:Main.java

public static Bundle createBundle(final String key, final boolean value) {
    final Bundle bundle = new Bundle();
    bundle.putBoolean(key, value);
    return bundle;
}

From source file:Main.java

public static void onSaveInstanceState(Bundle outState) {
    outState.putIntArray("drawables", menuItems);
    outState.putBoolean("isShowing", isShowing);
}

From source file:at.wada811.android.dialogfragments.sample.numberpickerdialogfragment.NumberPickerDialogFragmentExamplesFragment.java

public static NumberPickerDialogFragmentExamplesFragment newInstance(boolean isInActivity) {
    NumberPickerDialogFragmentExamplesFragment fragment = new NumberPickerDialogFragmentExamplesFragment();
    Bundle args = new Bundle();
    args.putBoolean(Const.KEY_IS_IN_ACTIVITY, isInActivity);
    fragment.setArguments(args);//from   w w w . j a v  a2  s. c o m
    return fragment;
}

From source file:at.wada811.android.dialogfragments.sample.stringpickerdialogfragment.StringPickerDialogFragmentExamplesFragment.java

public static StringPickerDialogFragmentExamplesFragment newInstance(boolean isInActivity) {
    StringPickerDialogFragmentExamplesFragment fragment = new StringPickerDialogFragmentExamplesFragment();
    Bundle args = new Bundle();
    args.putBoolean(Const.KEY_IS_IN_ACTIVITY, isInActivity);
    fragment.setArguments(args);//from   ww w .  j  ava 2  s  .  c o m
    return fragment;
}

From source file:at.wada811.android.dialogfragments.sample.timepickerdialogfragment.TimePickerDialogFragmentExamplesFragment.java

public static TimePickerDialogFragmentExamplesFragment newInstance(boolean isInActivity) {
    TimePickerDialogFragmentExamplesFragment fragment = new TimePickerDialogFragmentExamplesFragment();
    Bundle args = new Bundle();
    args.putBoolean(Const.KEY_IS_IN_ACTIVITY, isInActivity);
    fragment.setArguments(args);/*from   w  w w  . j  a v a2 s. c om*/
    return fragment;
}

From source file:at.wada811.android.dialogfragments.sample.datepickerdialogfragment.DatePickerDialogFragmentExamplesFragment.java

public static DatePickerDialogFragmentExamplesFragment newInstance(boolean isInActivity) {
    DatePickerDialogFragmentExamplesFragment fragment = new DatePickerDialogFragmentExamplesFragment();
    Bundle args = new Bundle();
    args.putBoolean(Const.KEY_IS_IN_ACTIVITY, isInActivity);
    fragment.setArguments(args);//from  www .ja  va2 s. co m
    return fragment;
}

From source file:bander.notepad.PasswordFragment.java

public static PasswordFragment newInstance(boolean isSetup) {
    PasswordFragment f = new PasswordFragment();

    // Supply index input as an argument.
    Bundle args = new Bundle();
    args.putBoolean("isSetup", isSetup);
    f.setArguments(args);/*  w  ww .  java 2  s  .  c  om*/

    return f;
}

From source file:Main.java

/**
 * Puts boolean value to bundle if passed and creates it if {@code null} passed.
 *
 * @param bundle to put into/*from w  ww.  ja v  a2 s  . c  o m*/
 * @param key    to to put under
 * @param value  to put
 * @return bundle with the newly put value
 */
public static Bundle putBoolean(Bundle bundle, String key, Boolean value) {
    if (bundle == null) {
        bundle = new Bundle();
    }
    bundle.putBoolean(key, value);
    return bundle;
}

From source file:com.manning.androidhacks.hack029.fragment.ColorFragment.java

public static ColorFragment newInstance(int color, String text, boolean isLandscape) {
    ColorFragment recreateFragment = new ColorFragment();

    Bundle args = new Bundle();
    args.putInt(COLOR_KEY, color);/*ww w .java 2  s .c om*/
    args.putString(TEXT_KEY, text);
    args.putBoolean(LANDSCAPE_KEY, isLandscape);

    recreateFragment.setArguments(args);

    return recreateFragment;
}