dlazaro66 / QRCodeReaderView

Modification of ZXING Barcode Scanner project for easy Android QR-Code detection and AR purposes
1.9k stars 491 forks source link

onQRCodeRead method called twice #136

Open aNnYvIrUs opened 7 years ago

aNnYvIrUs commented 7 years ago

Please check this onQRCodeRead method called twice.

datnt1987 commented 7 years ago

I have the same issue, onQRCodeRead method is called twice sometimes even though I called QRCodeReaderView.stopCamera() in onQRCodeRead method.

aNnYvIrUs commented 7 years ago

It's not a proper solution but temporary i had use boolean in onQRCodeRead method to prevent this. boolean isProcessing = false; //Inside method qrCodeReaderView.stopCamera(); if (!isProcessing) { isProcessing = true; Toast.makeText(activity, "Code==>" + barCode, Toast.LENGTH_SHORT).show(); } and then while you start/resume the camera then make variable false.

datnt1987 commented 7 years ago

Dear @aNnYvIrUs , currently that's an worthwhile solution. Thanks so much 👍

Rolf-Smit commented 7 years ago

There is an open PR for this, but so far nobody responded to it:

https://github.com/dlazaro66/QRCodeReaderView/pull/120

datnt1987 commented 7 years ago

I think this lib is not maintained anymore

dlazaro66 commented 7 years ago

@datnt1987 @Rolf-Smit sorry for the delayed response. #120 is now merged, I'll release a new version asap. I'll close the issue once the release is out

nitink133 commented 4 years ago

You can disable QR code decoding once it's read the QR. qrCodeReaderView?.setQRDecodingEnabled(false)