仅扫描QR码而不扫描条形码的扫描仪

问题描述 投票:0回答:1

[每次我使用QR_CODES功能时,它都会起作用,但是每当使用CODE_39或ALL_FORMATS之类的功能时,由于某种原因,它无法扫描条形码。

 public void receiveDetections(Detector.Detections<Barcode> detections) {
    final SparseArray<Barcode> detector = detections.getDetectedItems();
    if (detector.size() > 0 && detector != null) {
        textView.post(new Runnable() {
            @RequiresApi(api = Build.VERSION_CODES.O)
            @Override
            public void run() {
                textView.setText(detector.valueAt(0).displayValue);
            }
        });
    } else {
        System.out.println("not working");
    }
}
java android qr-code barcode barcode-scanner
1个回答
0
投票

扫描仪的供应商和型号是什么?

许多扫描仪允许您通过扫描设置条形码来添加一个字符串,该字符串指示在条形码之前读取/通知的条形码类型。通过识别它,您可以实施仅使用QR码并丢弃其他QR码的过程。

请检查扫描仪的用户手册。

© www.soinside.com 2019 - 2024. All rights reserved.