dlazaro66 / QRCodeReaderView

Modification of ZXING Barcode Scanner project for easy Android QR-Code detection and AR purposes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scan callback too frequently

apple2360541 opened this issue · comments

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

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

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

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.