android.os.Bundle.putBooleanArray()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中android.os.Bundle.putBooleanArray()方法的一些代码示例,展示了Bundle.putBooleanArray()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bundle.putBooleanArray()方法的具体详情如下:
包路径:android.os.Bundle
类名称:Bundle
方法名:putBooleanArray

Bundle.putBooleanArray介绍

暂无

代码示例

代码示例来源:origin: androidannotations/androidannotations

public I arg(String key, boolean[] value) {
  args.putBooleanArray(key, value);
  return (I) this;
}

代码示例来源:origin: ogaclejapan/SmartTabLayout

/**
 * 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;
}

代码示例来源:origin: ogaclejapan/SmartTabLayout

/**
 * 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;
}

代码示例来源:origin: bluelinelabs/Conductor

public BundleBuilder putBooleanArray(String key, boolean[] value) {
  bundle.putBooleanArray(key, value);
  return this;
}

代码示例来源:origin: f2prateek/dart

/**
 * 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;
}

代码示例来源:origin: facebook/facebook-android-sdk

/**
 * 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;
}

代码示例来源:origin: facebook/facebook-android-sdk

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);
}

代码示例来源:origin: facebook/facebook-android-sdk

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;
}

代码示例来源:origin: facebook/facebook-android-sdk

array[i] = jsonArray.getBoolean(i);
  bundle.putBooleanArray(key, array);
} else if (valueType.equals(TYPE_BYTE)) {
  bundle.putByte(key, (byte)json.getInt(JSON_VALUE));

代码示例来源:origin: pockethub/PocketHub

/**
 * 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);
}

代码示例来源:origin: konmik/nucleus

when(bundle.getString(anyString(), anyString())).thenAnswer(getOrDefault);
doAnswer(put).when(bundle).putBooleanArray(anyString(), any(boolean[].class));
when(bundle.getBooleanArray(anyString())).thenAnswer(get);

代码示例来源:origin: robolectric/robolectric

@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();
}

代码示例来源:origin: thoughtbot/expandable-recycler-view

/**
 * 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);
}

代码示例来源:origin: meituan/WMRouter

/**
 * 附加到Intent的Extra
 */
public DefaultUriRequest putExtra(String name, boolean[] value) {
  extra().putBooleanArray(name, value);
  return this;
}

代码示例来源:origin: 80945540/FreeBook

/**
 * 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;
}

代码示例来源:origin: 80945540/LCRapidDevelop

/**
 * 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;
}

代码示例来源:origin: com.codeslap/groundy

/**
 * 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;
}

代码示例来源:origin: consp1racy/android-support-preference

@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);
}

代码示例来源:origin: doc-rj/smartcard-reader

@Override
public void onSaveInstanceState(Bundle outState) {
  GroupItem groupItem = mGrpAdapter.getGroup(0);
  outState.putBooleanArray("member_array", groupItem.member);
}

代码示例来源:origin: andforce/iBeebo

@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);
}

相关文章

Bundle类方法