public I arg(String key, boolean[] value) { args.putBooleanArray(key, value); return (I) this; }
/** * Inserts a boolean array value into the mapping of this Bundle, replacing * any existing value for the given key. Either key or value may be null. * * @param key a String, or null * @param value a boolean array object, or null */ public Bundler putBooleanArray(String key, boolean[] value) { bundle.putBooleanArray(key, value); return this; }
/** * Inserts a boolean array value into the mapping of this Bundle, replacing * any existing value for the given key. Either key or value may be null. * * @param key a String, or null * @param value a boolean array object, or null */ public Bundler putBooleanArray(String key, boolean[] value) { bundle.putBooleanArray(key, value); return this; }
public BundleBuilder putBooleanArray(String key, boolean[] value) { bundle.putBooleanArray(key, value); return this; }
/** * Inserts a boolean array value into the mapping of the underlying Bundle, replacing any existing * value for the given key. Either key or value may be null. * * @param key a String, or null * @param value a boolean array object, or null * @return this bundler instance to chain method calls */ public Bundler put(String key, boolean[] value) { delegate.putBooleanArray(key, value); return this; }
/** * Sets an array of boolean values in the object. * @param key The key for the value. * @param value The value. * @return The builder. */ public E putBooleanArray(final String key, @Nullable final boolean[] value) { this.bundle.putBooleanArray(key, value); return (E)this; }
private static void putBooleanArray(String key, Bundle bundle) { int length = random.nextInt(50); boolean[] array = new boolean[length]; for (int i = 0; i < length; i++) { array[i] = random.nextBoolean(); } bundle.putBooleanArray(key, array); }
public static boolean putJSONValueInBundle(Bundle bundle, String key, Object value) { if (value == null) { bundle.remove(key); } else if (value instanceof Boolean) { bundle.putBoolean(key, (boolean) value); } else if (value instanceof boolean[]) { bundle.putBooleanArray(key, (boolean[]) value); } else if (value instanceof Double) { bundle.putDouble(key, (double) value); } else if (value instanceof double[]) { bundle.putDoubleArray(key, (double[]) value); } else if (value instanceof Integer) { bundle.putInt(key, (int) value); } else if (value instanceof int[]) { bundle.putIntArray(key, (int[]) value); } else if (value instanceof Long) { bundle.putLong(key, (long) value); } else if (value instanceof long[]) { bundle.putLongArray(key, (long[]) value); } else if (value instanceof String) { bundle.putString(key, (String) value); } else if (value instanceof JSONArray) { bundle.putString(key, value.toString()); } else if (value instanceof JSONObject) { bundle.putString(key, value.toString()); } else { return false; } return true; }
array[i] = jsonArray.getBoolean(i); bundle.putBooleanArray(key, array); } else if (valueType.equals(TYPE_BYTE)) { bundle.putByte(key, (byte)json.getInt(JSON_VALUE));
/** * Confirm message and deliver callback to given activity * * @param activity * @param requestCode * @param title * @param message * @param choices * @param selectedChoices */ public static void show(final BaseActivity activity, final int requestCode, final String title, final String message, final ArrayList<Label> choices, final boolean[] selectedChoices) { Bundle arguments = createArguments(title, message, requestCode); arguments.putParcelableArrayList(ARG_CHOICES, choices); arguments.putBooleanArray(ARG_SELECTED_CHOICES, selectedChoices); show(activity, new LabelsDialogFragment(), arguments, TAG); }
when(bundle.getString(anyString(), anyString())).thenAnswer(getOrDefault); doAnswer(put).when(bundle).putBooleanArray(anyString(), any(boolean[].class)); when(bundle.getBooleanArray(anyString())).thenAnswer(get);
@Test public void booleanArray() { boolean [] arr = new boolean[] { false, true }; bundle.putBooleanArray("foo", arr); assertThat(bundle.getBooleanArray("foo")).isEqualTo(arr); assertThat(bundle.getBooleanArray("bar")).isNull(); }
/** * Stores the expanded state map across state loss. * <p> * Should be called from whatever {@link Activity} that hosts the RecyclerView that {@link * ExpandableRecyclerViewAdapter} is attached to. * <p> * This will make sure to add the expanded state map as an extra to the * instance state bundle to be used in {@link #onRestoreInstanceState(Bundle)}. * * @param savedInstanceState The {@code Bundle} into which to store the * expanded state map */ public void onSaveInstanceState(Bundle savedInstanceState) { savedInstanceState.putBooleanArray(EXPAND_STATE_MAP, expandableList.expandedGroupIndexes); }
/** * 附加到Intent的Extra */ public DefaultUriRequest putExtra(String name, boolean[] value) { extra().putBooleanArray(name, value); return this; }
/** * Inserts a boolean array value into the mapping of this Bundle, replacing * any existing value for the given key. Either key or value may be null. * * @param key a String, or null * @param value a boolean array object, or null */ public Bundler putBooleanArray(String key, boolean[] value) { bundle.putBooleanArray(key, value); return this; }
/** * Inserts a boolean array value into the mapping of this Bundle, replacing * any existing value for the given key. Either key or value may be null. * * @param key a String, or null * @param value a boolean array object, or null */ public Bundler putBooleanArray(String key, boolean[] value) { bundle.putBooleanArray(key, value); return this; }
/** * Inserts a boolean array value into the mapping of this Bundle, replacing * any existing value for the given key. Either key or value may be null. * * @param key a String, or null * @param value a boolean array object, or null */ public Bundler add(String key, boolean[] value) { mBundle.putBooleanArray(key, value); return this; }
@Override public void onSaveInstanceState(final @NonNull Bundle outState) { super.onSaveInstanceState(outState); outState.putSerializable(TAG + ".mNewValues", mNewValues); outState.putBooleanArray(TAG + ".mSelectedItems", mSelectedItems); outState.putBoolean(TAG + ".mPreferenceChanged", mPreferenceChanged); }
@Override public void onSaveInstanceState(Bundle outState) { GroupItem groupItem = mGrpAdapter.getGroup(0); outState.putBooleanArray("member_array", groupItem.member); }
@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putParcelable("group", group); outState.putString("uid", uid); outState.putStringArray("valueArray", valueArray); outState.putBooleanArray("selectedArray", selectedArray); outState.putStringArrayList("currentList", currentList); outState.putStringArrayList("addList", addList); outState.putStringArrayList("removeList", removeList); }