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

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

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

Bundle.putLongArray介绍

暂无

代码示例

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

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

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

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

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

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

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

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

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

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

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

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

代码示例来源:origin: k9mail/k-9

/**
 * Write the unique IDs of selected messages to a {@link Bundle}.
 */
private void saveSelectedMessages(Bundle outState) {
  long[] selected = new long[this.selected.size()];
  int i = 0;
  for (Long id : this.selected) {
    selected[i++] = id;
  }
  outState.putLongArray(STATE_SELECTED_MESSAGES, selected);
}

代码示例来源:origin: naman14/Timber

public static CreatePlaylistDialog newInstance(long[] songList) {
  CreatePlaylistDialog dialog = new CreatePlaylistDialog();
  Bundle bundle = new Bundle();
  bundle.putLongArray("songs", songList);
  dialog.setArguments(bundle);
  return dialog;
}

代码示例来源:origin: naman14/Timber

public static AddPlaylistDialog newInstance(long[] songList) {
  AddPlaylistDialog dialog = new AddPlaylistDialog();
  Bundle bundle = new Bundle();
  bundle.putLongArray("songs", songList);
  dialog.setArguments(bundle);
  return dialog;
}

代码示例来源:origin: aa112901/remusic

public static AddPlaylistDialog newInstance(long[] songList) {
  AddPlaylistDialog dialog = new AddPlaylistDialog();
  Bundle bundle = new Bundle();
  bundle.putLongArray("songs", songList);
  dialog.setArguments(bundle);
  return dialog;
}

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

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

代码示例来源:origin: mikepenz/FastAdapter

@Override
public void saveInstanceState(@Nullable Bundle savedInstanceState, String prefix) {
  if (savedInstanceState == null) {
    return;
  }
  Set<Item> selections = mFastAdapter.getSelectedItems();
  long[] selectionsArray = new long[selections.size()];
  int i = 0;
  for (Item item : selections) {
    selectionsArray[i] = item.getIdentifier();
    i++;
  }
  //remember the selections
  savedInstanceState.putLongArray(BUNDLE_SELECTIONS + prefix, selectionsArray);
}

代码示例来源: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.getLong(i);
  bundle.putLongArray(key, array);
} else if (valueType.equals(TYPE_FLOAT)) {
  bundle.putFloat(key, (float)json.getDouble(JSON_VALUE));

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

when(bundle.getBooleanArray(anyString())).thenAnswer(get);
doAnswer(put).when(bundle).putLongArray(anyString(), any(long[].class));
when(bundle.getLongArray(anyString())).thenAnswer(get);

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

@Test
public void longArray() {
 long [] arr = new long[] { 23, 11 };
 bundle.putLongArray("foo", arr);
 assertThat(bundle.getLongArray("foo")).isEqualTo(arr);
 assertThat(bundle.getLongArray("bar")).isNull();
}

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

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

代码示例来源:origin: curtis2/SuperVideoPlayer

private void updateCacheStatus(int type, int info, long[] segments) {
 if (mEventHandler != null) {
  Message m = mEventHandler.obtainMessage(MEDIA_CACHING_UPDATE);
  Bundle b = m.getData();
  b.putInt(MEDIA_CACHING_TYPE, type);
  b.putInt(MEDIA_CACHING_INFO, info);
  b.putLongArray(MEDIA_CACHING_SEGMENTS, segments);
  mEventHandler.sendMessage(m);
 }
}

代码示例来源:origin: stackoverflow.com

super.onSaveInstanceState(outState);
this.expandedIds = getExpandedIds();
outState.putLongArray("ExpandedIds", this.expandedIds);

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

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

相关文章

Bundle类方法