dlazaro66 / QRCodeReaderView

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

Scan callback too frequently #164

Open apple2360541 opened 6 years ago

apple2360541 commented 6 years ago

I cannot set the callback time ;when scan success,I send my request to server;but the scan call back so frequently that it send so many requests to my server

f839903061 commented 5 years ago

@apple2360541 请问这个问题你解决了吗,我也要遇到了这个问题,扫码频率太快了,而且多

alisubhani313 commented 4 years ago

i am also facing same issue. How to resolve this.

yunusemredilber commented 4 years ago

Well, you can stop QR decoding at the first callback. And when your operation is done, you can restart it (or not). Here is a simple example that I'm using:

@Override
 public void onQRCodeRead(String text, PointF[] points) {
     qrCodeReaderView.setQRDecodingEnabled(false);
     Helper.showStandardDialog(this, text, () -> {
         // This code executed when the user touches the "ok" button.
         qrCodeReaderView.setQRDecodingEnabled(true);
     });
}

You get the point.