Android Как возможно сканирование штрих-кода во время видеозвонка - PullRequest
0 голосов
/ 10 января 2020

Как читать штрих-код на видеозвонке (мы используем Agora.io ). Мы пытаемся Штрих-код API для чтения штрих-кода.

Попытка с примером кода ниже

barcodeDetector.setProcessor(new Detector.Processor<Barcode>() {
        @Override
        public void release() {
            Toast.makeText(getApplicationContext(), "To prevent memory leaks barcode scanner has been stopped", Toast.LENGTH_SHORT).show();
        }

        @Override
        public void receiveDetections(Detector.Detections<Barcode> detections) {
            final SparseArray<Barcode> barcodes = detections.getDetectedItems();
            if (barcodes.size() != 0) {


                txtBarcodeValue.post(new Runnable() {

                    @Override
                    public void run() {

                        if (barcodes.valueAt(0).email != null) {
                            txtBarcodeValue.removeCallbacks(null);
                            intentData = barcodes.valueAt(0).email.address;
                            txtBarcodeValue.setText(intentData);
                            isEmail = true;
                            btnAction.setText("ADD CONTENT TO THE MAIL");
                        } else {
                            isEmail = false;
                            btnAction.setText("LAUNCH URL");
                            intentData = barcodes.valueAt(0).displayValue;
                            txtBarcodeValue.setText(intentData);

                        }
                    }
                });

            }
        }
    });

Но ответа нет. Пожалуйста, укажите ваши ценные комментарии ...

...