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

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

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

Bundle.putShort介绍

暂无

代码示例

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

public I arg(String key, short value) {
  args.putShort(key, value);
  return (I) this;
}

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

bundle.putShort(key, (short)json.getInt(JSON_VALUE));
} else if (valueType.equals(TYPE_SHORT_ARRAY)) {
  JSONArray jsonArray = json.getJSONArray(JSON_VALUE);

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

/**
 * Inserts a short value into the mapping of this Bundle, replacing
 * any existing value for the given key.
 *
 * @param key   a String, or null
 * @param value a short
 */
public Bundler putShort(String key, short value) {
 bundle.putShort(key, value);
 return this;
}

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

when(bundle.hasFileDescriptors()).thenAnswer(unsupported);
doAnswer(put).when(bundle).putShort(anyString(), anyShort());
when(bundle.getShort(anyString())).thenAnswer(get);
when(bundle.getShort(anyString(), anyShort())).thenAnswer(getOrDefault);

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

/**
 * Inserts a short value into the mapping of this Bundle, replacing
 * any existing value for the given key.
 *
 * @param key   a String, or null
 * @param value a short
 */
public Bundler putShort(String key, short value) {
 bundle.putShort(key, value);
 return this;
}

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

public BundleBuilder putShort(String key, short value) {
  bundle.putShort(key, value);
  return this;
}

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

/**
 * Inserts a short value into the mapping of the underlying Bundle, replacing any existing value
 * for the given key.
 *
 * @param key a String, or null
 * @param value a short
 * @return this bundler instance to chain method calls
 */
public Bundler put(String key, short value) {
 delegate.putShort(key, value);
 return this;
}

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

private static void putShort(String key, Bundle bundle) {
  bundle.putShort(key, (short)random.nextInt());
}

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

@Test
  public void testUnsupportedValues() throws JSONException {
    Bundle b = new Bundle();
    b.putShort("shortValue", (short)7);

    boolean exceptionCaught = false;
    try {
      BundleJSONConverter.convertToJSON(b);
    } catch (IllegalArgumentException a) {
      exceptionCaught = true;
    }
    assertTrue(exceptionCaught);

    JSONArray jsonArray = new JSONArray();
    jsonArray.put(10);
    JSONObject json = new JSONObject();
    json.put("arrayValue", jsonArray);

    exceptionCaught = false;
    try {
      BundleJSONConverter.convertToBundle(json);
    } catch (IllegalArgumentException a) {
      exceptionCaught = true;
    }
    assertTrue(exceptionCaught);
  }
}

代码示例来源:origin: jberkel/sms-backup-plus

public BundleBuilder putShort(String key, short value) {
  bundle.putShort(key, value);
  return this;
}

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

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

代码示例来源:origin: limedroid/XDroidMvp

public Router putShort(@Nullable String key, short value) {
  getBundleData().putShort(key, value);
  return this;
}

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

public void putBoxedShort(Bundle state, String key, Short x) {
  if (x != null) {
    state.putShort(key + mBaseKey, x);
  }
}

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

/**
 * Inserts a short value into the mapping of this Bundle, replacing
 * any existing value for the given key.
 *
 * @param key   a String, or null
 * @param value a short
 */
public Bundler putShort(String key, short value) {
 bundle.putShort(key, value);
 return this;
}

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

/**
 * Inserts a short value into the mapping of this Bundle, replacing
 * any existing value for the given key.
 *
 * @param key   a String, or null
 * @param value a short
 */
public Bundler putShort(String key, short value) {
 bundle.putShort(key, value);
 return this;
}

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

/**
 * Inserts a short value into the mapping of this Bundle, replacing
 * any existing value for the given key.
 *
 * @param key   a String, or null
 * @param value a short
 */
public Bundler add(String key, short value) {
  mBundle.putShort(key, value);
  return this;
}

代码示例来源:origin: com.github.stephanenicolas.dart.v2/henson

/**
 * Inserts a short value into the mapping of the underlying Bundle, replacing
 * any existing value for the given key.
 *
 * @param key a String, or null
 * @param value a short
 * @return this bundler instance to chain method calls
 */
public Bundler put(String key, short value) {
 delegate.putShort(key, value);
 return this;
}

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

Bundle nfcaBundle = new Bundle();
nfcaBundle.putByteArray(EXTRA_NFC_A_ATQA, new byte[]{ (byte)0x44, (byte)0x00 }); //ATQA for Type 2 tag
nfcaBundle.putShort(EXTRA_NFC_A_SAK , (short)0x00); //SAK for Type 2 tag

Bundle ndefBundle = new Bundle();
ndefBundle.putInt(EXTRA_NDEF_MAXLENGTH, 48); // maximum message length: 48 bytes
ndefBundle.putInt(EXTRA_NDEF_CARDSTATE, 1); // read-only
ndefBundle.putInt(EXTRA_NDEF_TYPE, 2); // Type 2 tag
NdefMessage myNdefMessage = ...; // create an NDEF message
ndefBundle.putParcelable(EXTRA_NDEF_MSG, myNdefMessage);  // add an NDEF message

代码示例来源:origin: drakeet/Floo

@NonNull @Override @CheckResult
public Navigation putExtra(@NonNull String key, short value) {
  bundle.putShort(key, value);
  return this;
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

public void joinSession(@NonNull String busName, short port,
            @NonNull ResultReceiver resultReceiver) {
  final Message msg = new Message();
  msg.what = MSG_TYPE_JOIN_SESSION;
  Bundle data = new Bundle();
  data.putString(PARAM_BUS_NAME, busName);
  data.putShort(PARAM_PORT, port);
  data.putParcelable(PARAM_RESULT_RECEIVER, resultReceiver);
  msg.obj = data;
  mAllJoynHandler.sendMessage(msg);
}

相关文章

Bundle类方法