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

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

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

Bundle.putIntArray介绍

暂无

代码示例

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

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

代码示例来源:origin: Yalantis/uCrop

/**
 * Choose what set of gestures will be enabled on each tab - if any.
 */
public void setAllowedGestures(@UCropActivity.GestureTypes int tabScale,
                @UCropActivity.GestureTypes int tabRotate,
                @UCropActivity.GestureTypes int tabAspectRatio) {
  mOptionBundle.putIntArray(EXTRA_ALLOWED_GESTURES, new int[]{tabScale, tabRotate, tabAspectRatio});
}

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

/**
 * Inserts an int 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 an int array object, or null
 */
public Bundler putIntArray(String key, int[] value) {
 bundle.putIntArray(key, value);
 return this;
}

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

/**
 * Inserts an int 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 an int array object, or null
 */
public Bundler putIntArray(String key, int[] value) {
 bundle.putIntArray(key, value);
 return this;
}

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

/**
 * Inserts an int 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 an int array object, or null
 * @return this bundler instance to chain method calls
 */
public Bundler put(String key, int[] value) {
 delegate.putIntArray(key, value);
 return this;
}

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

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

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

/**
 * Sets an array of int values in the object.
 * @param key The key for the value.
 * @param value The value.
 * @return The builder.
 */
public E putIntArray(final String key, @Nullable final int[] value) {
  this.bundle.putIntArray(key, value);
  return (E)this;
}

代码示例来源:origin: iSoron/uhabits

@Override
  public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putIntArray(KEY_COLORS, mColors);
    outState.putSerializable(KEY_SELECTED_COLOR, mSelectedColor);
  }
}

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

@Override
public Parcelable saveState() {
  Bundle bundle = new Bundle();
  bundle.putBoolean(KEY_SAVES_STATE, savesState);
  bundle.putSparseParcelableArray(KEY_SAVED_PAGES, savedPages);
  int[] visiblePageIdsKeys = new int[visiblePageIds.size()];
  String[] visiblePageIdsValues = new String[visiblePageIds.size()];
  for (int i = 0; i < visiblePageIds.size(); i++) {
    visiblePageIdsKeys[i] = visiblePageIds.keyAt(i);
    visiblePageIdsValues[i] = visiblePageIds.valueAt(i);
  }
  bundle.putIntArray(KEY_VISIBLE_PAGE_IDS_KEYS, visiblePageIdsKeys);
  bundle.putStringArray(KEY_VISIBLE_PAGE_IDS_VALUES, visiblePageIdsValues);
  return bundle;
}

代码示例来源:origin: seven332/EhViewer

@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
  super.onSaveInstanceState(outState);
  boolean hasFirstRefresh;
  if (mHelper != null && 1 == mHelper.getShownViewIndex()) {
    hasFirstRefresh = false;
  } else {
    hasFirstRefresh = mHasFirstRefresh;
  }
  outState.putBoolean(KEY_HAS_FIRST_REFRESH, hasFirstRefresh);
  outState.putParcelable(KEY_URL_BUILDER, mUrlBuilder);
  outState.putBoolean(KEY_SEARCH_MODE, mSearchMode);
  outState.putIntArray(KEY_FAV_COUNT_ARRAY, mFavCountArray);
}

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

private static void putIntArray(String key, Bundle bundle) {
  int length = random.nextInt(50);
  int[] array = new int[length];
  for (int i = 0; i < length; i++) {
    array[i] = random.nextInt();
  }
  bundle.putIntArray(key, array);
}

代码示例来源:origin: hidroh/materialistic

private void showPreferences() {
  Bundle args = new Bundle();
  args.putInt(PopupSettingsFragment.EXTRA_TITLE, R.string.list_display_options);
  args.putInt(PopupSettingsFragment.EXTRA_SUMMARY, R.string.pull_up_hint);
  args.putIntArray(PopupSettingsFragment.EXTRA_XML_PREFERENCES, new int[]{
      R.xml.preferences_font,
      R.xml.preferences_list});
  ((DialogFragment) Fragment.instantiate(getActivity(),
      PopupSettingsFragment.class.getName(), args))
      .show(getFragmentManager(), PopupSettingsFragment.class.getName());
}

代码示例来源:origin: hidroh/materialistic

private void showPreferences() {
  Bundle args = new Bundle();
  args.putInt(PopupSettingsFragment.EXTRA_TITLE, R.string.font_options);
  args.putInt(PopupSettingsFragment.EXTRA_SUMMARY, R.string.pull_up_hint);
  args.putIntArray(PopupSettingsFragment.EXTRA_XML_PREFERENCES, new int[]{
      R.xml.preferences_font,
      R.xml.preferences_comments});
  ((DialogFragment) Fragment.instantiate(getActivity(),
      PopupSettingsFragment.class.getName(), args))
      .show(getFragmentManager(), PopupSettingsFragment.class.getName());
}

代码示例来源:origin: LawnchairLauncher/Lawnchair

private void onComplete(int requestCode, String[] permissions, int[] grantResult) {
  Bundle bundle = new Bundle();
  bundle.putStringArray("permissions", permissions);
  bundle.putIntArray("grantResult", grantResult);
  bundle.putInt("requestCode", requestCode);
  // Send our callback to the result receiver
  resultReceiver.send(requestCode, bundle);
  finish();
}

代码示例来源:origin: hidroh/materialistic

private void showPreferences() {
  Bundle args = new Bundle();
  args.putInt(PopupSettingsFragment.EXTRA_TITLE, R.string.font_options);
  args.putIntArray(PopupSettingsFragment.EXTRA_XML_PREFERENCES,
      new int[]{R.xml.preferences_readability});
  ((DialogFragment) Fragment.instantiate(getActivity(),
      PopupSettingsFragment.class.getName(), args))
      .show(getFragmentManager(), PopupSettingsFragment.class.getName());
}

代码示例来源:origin: chentao0707/SimplifyReader

ss.putIntArray("viewTops", mPendingSync.viewTops);
  ss.putInt("position", mPendingSync.position);
  ss.putInt("height", mPendingSync.height);
    viewTops[i] = getChildAt(i).getTop();
  ss.putIntArray("viewTops", viewTops);
} else {
  ss.putInt("viewTop",  0);
  ss.putLong("firstId", INVALID_POSITION);
  ss.putInt("position", 0);
  ss.putIntArray("viewTops", new int[1]);

代码示例来源: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: firebase/firebase-jobdispatcher-android

private static void writeContentUriTriggerToBundle(Bundle data, ContentUriTrigger uriTrigger) {
 data.putInt(BundleProtocol.PACKED_PARAM_TRIGGER_TYPE, BundleProtocol.TRIGGER_TYPE_CONTENT_URI);
 int size = uriTrigger.getUris().size();
 int[] flagsArray = new int[size];
 Uri[] uriArray = new Uri[size];
 for (int i = 0; i < size; i++) {
  ObservedUri uri = uriTrigger.getUris().get(i);
  flagsArray[i] = uri.getFlags();
  uriArray[i] = uri.getUri();
 }
 data.putIntArray(BundleProtocol.PACKED_PARAM_CONTENT_URI_FLAGS_ARRAY, flagsArray);
 data.putParcelableArray(BundleProtocol.PACKED_PARAM_CONTENT_URI_ARRAY, uriArray);
}

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

array[i] = jsonArray.getInt(i);
  bundle.putIntArray(key, array);
} else if (valueType.equals(TYPE_LONG)) {
  bundle.putLong(key, json.getLong(JSON_VALUE));

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

@Test
public void intArray() {
 int [] arr = new int[] { 87, 65 };
 bundle.putIntArray("foo", arr);
 assertThat(bundle.getIntArray("foo")).isEqualTo(arr);
 assertThat(bundle.getIntArray("bar")).isNull();
}

相关文章

Bundle类方法