me.dm7.barcodescanner.zbar.ZBarScannerView.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(84)

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

ZBarScannerView.<init>介绍

暂无

代码示例

代码示例来源:origin: pinetum/AirUnlock-for-Android

@Override
public void onCreate(Bundle state) {
  super.onCreate(state);
  Log.i(TAG,"OnCreate");
  List<BarcodeFormat> mformats = new ArrayList<BarcodeFormat>();
  mScannerView = new ZBarScannerView(this);    // Programmatically initialize the scanner view
  mformats.add(BarcodeFormat.QRCODE);
  mScannerView.setFormats(mformats);
  setContentView(mScannerView);                // Set the scanner view as the content view
  if (ContextCompat.checkSelfPermission(this,
      Manifest.permission.CAMERA)
      != PackageManager.PERMISSION_GRANTED) {
      ActivityCompat.requestPermissions(this,
          new String[]{Manifest.permission.CAMERA},
          CAMERA_PERRMISSION_REQUEST);
  }
}

代码示例来源:origin: denzilferreira/aware-client

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  mScannerView = new ZBarScannerView(this);
  LinearLayout main = new LinearLayout(this);
  main.setOrientation(LinearLayout.VERTICAL);
  ListView list = new ListView(this);
  list.setId(android.R.id.list);
  list.setVisibility(View.GONE);
  main.addView(mScannerView);
  main.addView(list);
  setContentView(main);
}

相关文章