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

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

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

Bundle.getByte介绍

暂无

代码示例

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

when(bundle.getByte(anyString())).thenAnswer(get);
when(bundle.getByte(anyString(), anyByte())).thenAnswer(getOrDefault);

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

public byte getByte(Bundle state, String key) {
  return state.getByte(key + mBaseKey);
}

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

assertEquals(originalBundle.getByte(BYTE_KEY), cachedBundle.getByte(BYTE_KEY));
assertArrayEquals(originalBundle.getByteArray(BYTE_ARRAY_KEY), cachedBundle.getByteArray(BYTE_ARRAY_KEY));
assertEquals(originalBundle.getShort(SHORT_KEY), cachedBundle.getShort(SHORT_KEY));

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

public byte getByte(String key,byte defValue){
  if (mBundle != null) {
    return mBundle.getByte(key,defValue);
  }
  return defValue;
}
public byte[] getBytes(String key){

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

/**
 * Retrieve extended data from the request.
 *
 * @param name         The name of the desired item.
 * @param defaultValue the value to be returned if no value of the desired type is
 *                     stored with the given name.
 * @return the value of an item that previously added with putExtra() or the
 * default value if none was found.
 * @see #putExtra(String, byte)
 */
public byte getByteExtra(String name, byte defaultValue) {
  return mExtras == null ? defaultValue : mExtras.getByte(name,
      defaultValue);
}

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

Bundle bundle = this.getIntent().getExtras();
   byte info = bundle.getByte("info");

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

public Byte getBoxedByte(Bundle state, String key) {
  if (state.containsKey(key + mBaseKey)) {
    return state.getByte(key + mBaseKey);
  }
  return null;
}

代码示例来源:origin: GuoJinyu/SimpleZXing

private void bundleSetting(Bundle bundle) {
  if (bundle == null) {
    bundle = new Bundle();
  }
  flashlightMode = bundle.getByte(KEY_FLASHLIGHT_MODE, VALUE_FLASHLIGHT_OFF);
  orientationMode = bundle.getByte(KEY_ORIENTATION_MODE, VALUE_ORIENTATION_PORTRAIT);
  needBeep = bundle.getBoolean(KEY_NEED_BEEP, VALUE_BEEP);
  needVibration = bundle.getBoolean(KEY_NEED_VIBRATION, VALUE_VIBRATION);
  needExposure = bundle.getBoolean(KEY_NEED_EXPOSURE, VALUE_NO_EXPOSURE);
  needFullScreen = bundle.getBoolean(KEY_SCAN_AREA_FULL_SCREEN, VALUE_SCAN_AREA_VIEW_FINDER);
  needScanHintText = bundle.getBoolean(KEY_NEED_SCAN_HINT_TEXT, VALUE_NO_SCAN_HINT_TEXT);
  switch (orientationMode) {
    case VALUE_ORIENTATION_LANDSCAPE:
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
      break;
    case VALUE_ORIENTATION_PORTRAIT:
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
      break;
    default:
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
      break;
  }
  switch (flashlightMode) {
    case VALUE_FLASHLIGHT_AUTO:
      ambientLightManager = new AmbientLightManager(this);
      break;
  }
  beepManager = new BeepManager(this, needBeep, needVibration);
}

代码示例来源:origin: Meituan-Dianping/Shield

public static byte getByteParam(String name, byte defaultValue, Fragment fragment) {
  if (fragment.getArguments() != null && fragment.getArguments().containsKey(name)) {
    return fragment.getArguments().getByte(name);
  }
  Intent i = fragment.getActivity().getIntent();
  try {
    Uri uri = i.getData();
    if (uri != null) {
      String val = uri.getQueryParameter(name);
      if (!TextUtils.isEmpty(val))
        return Byte.parseByte(val);
    }
  } catch (Exception e) {
    e.printStackTrace();
  }
  return i.getByteExtra(name, defaultValue);
}

代码示例来源:origin: Nimrodda/WizarDroid

args.putByte(field.getName(), context.getByte(field.getName()));

代码示例来源:origin: laserwave/reversi

playerColor = bundle.getByte("playerColor");
aiColor = (byte) -playerColor;
difficulty = bundle.getInt("difficulty");

相关文章

Bundle类方法