dlazaro66 / QRCodeReaderView

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

Time between reading #90

Closed victorpigmeo closed 8 years ago

victorpigmeo commented 8 years ago

My application send a Toast when the code (read by the QRCodeReader) doesn't exists, but the reader is always enabled, it read the code many times and send a lot of Toasts, how can I configure it to read a code and "wait" some time to read again? I tried with sleep from java.concurrent.TimeUnit but then the Toast isn't shown.

dlazaro66 commented 8 years ago

sorry, you should NOT sleep the thread to delay the Toast to appear. Instead, you should manage your logic and desired behavior with the help of this method :

// Use this function to enable/disable decoding
        mydecoderview.setQRDecodingEnabled(true);

You can for example: Start Decoding - Receive the result callback - Stop decoding - show the Toast - wait for a while - Start decoding again.