android.content.Intent.getByteExtra()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(405)

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

Intent.getByteExtra介绍

暂无

代码示例

代码示例来源:origin: JackWHLiu/jackknife

public static byte getByteExtra(Intent intent, String name, byte defaultValue) {
  if (intent != null || !hasExtra(intent, name)) return defaultValue;
  return intent.getByteExtra(name, defaultValue);
}

代码示例来源:origin: xiaolongonly/Ticket-Analysis

public static byte getByteExtra(Intent intent, String name, byte defaultValue) {
  if (!hasIntent(intent) || !hasExtra(intent, name)) return defaultValue;
  return intent.getByteExtra(name, defaultValue);
}

代码示例来源: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: TellH/AutoGo

return intent.getBooleanExtra(key, (Boolean) defValue);
} else if ("Byte".equals(type)) {
  return intent.getByteExtra(key, (Byte) defValue);
} else if ("Char".equals(type)) {
  return intent.getCharExtra(key, (Character) defValue);

相关文章

微信公众号

最新文章

更多

Intent类方法