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

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

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

Bundle.getShortArray介绍

暂无

代码示例

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

@Test
public void shortArray() {
 short [] arr = new short[] { 89, 37 };
 bundle.putShortArray("foo", arr);
 assertThat(bundle.getShortArray("foo")).isEqualTo(arr);
 assertThat(bundle.getShortArray("bar")).isNull();
}

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

when(bundle.getShortArray(anyString())).thenAnswer(get);

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

@Test
public void getWrongType() {
 bundle.putFloat("foo", 5f);
 assertThat(bundle.getCharArray("foo")).isNull();
 assertThat(bundle.getInt("foo")).isEqualTo(0);
 assertThat(bundle.getIntArray("foo")).isNull();
 assertThat(bundle.getIntegerArrayList("foo")).isNull();
 assertThat(bundle.getShort("foo")).isEqualTo((short) 0);
 assertThat(bundle.getShortArray("foo")).isNull();
 assertThat(bundle.getBoolean("foo")).isFalse();
 assertThat(bundle.getBooleanArray("foo")).isNull();
 assertThat(bundle.getLong("foo")).isEqualTo(0);
 assertThat(bundle.getLongArray("foo")).isNull();
 assertThat(bundle.getFloatArray("foo")).isNull();
 assertThat(bundle.getDouble("foo")).isEqualTo(0.0);
 assertThat(bundle.getDoubleArray("foo")).isNull();
 assertThat(bundle.getString("foo")).isNull();
 assertThat(bundle.getStringArray("foo")).isNull();
 assertThat(bundle.getStringArrayList("foo")).isNull();
 assertThat(bundle.getBundle("foo")).isNull();
 assertThat((Parcelable) bundle.getParcelable("foo")).isNull();
 assertThat(bundle.getParcelableArray("foo")).isNull();
 assertThat(bundle.getParcelableArrayList("foo")).isNull();
 bundle.putInt("foo", 1);
 assertThat(bundle.getFloat("foo")).isEqualTo(0.0f);
}

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

assertArrayEquals(originalBundle.getByteArray(BYTE_ARRAY_KEY), cachedBundle.getByteArray(BYTE_ARRAY_KEY));
assertEquals(originalBundle.getShort(SHORT_KEY), cachedBundle.getShort(SHORT_KEY));
assertArrayEquals(originalBundle.getShortArray(SHORT_ARRAY_KEY), cachedBundle.getShortArray(SHORT_ARRAY_KEY));
assertEquals(originalBundle.getInt(INT_KEY), cachedBundle.getInt(INT_KEY));
assertArrayEquals(originalBundle.getIntArray(INT_ARRAY_KEY), cachedBundle.getIntArray(INT_ARRAY_KEY));

代码示例来源:origin: fengdai/FragmentMaster

/**
 * Retrieve extended data from the request.
 *
 * @param name The name of the desired item.
 * @return the value of an item that previously added with putExtra() or
 * null if no short array value was found.
 * @see #putExtra(String, short[])
 */
public short[] getShortArrayExtra(String name) {
  return mExtras == null ? null : mExtras.getShortArray(name);
}

代码示例来源:origin: kayoSun/Tack

public short[] getShorts(String key){
  if (mBundle != null) {
    return mBundle.getShortArray(key);
  }
  return null;
}

代码示例来源:origin: evernote/android-state

public short[] getShortArray(Bundle state, String key) {
  return state.getShortArray(key + mBaseKey);
}

代码示例来源:origin: gkasten/drrickorang

private BufferCallbackTimes(Parcel source) {
  Bundle in = source.readBundle(getClass().getClassLoader());
  mTimeStamps = in.getIntArray("mTimeStamps");
  mCallbackDurations = in.getShortArray("mCallbackDurations");
  mExpectedBufferPeriod = in.getShort("mExpectedBufferPeriod");
  mExceededCapacity = in.getBoolean("mExceededCapacity");
  mIndex = in.getInt("mIndex");
}

代码示例来源:origin: fasteque/rgb-tool

rgbaValues = getArguments().getShortArray(ARG_RGBA_VALUES);

相关文章

Bundle类方法