jenly1314 / ZXingLite

🔥 ZXing的精简极速版,优化扫码和生成二维码/条形码,内置闪光灯等功能。扫描风格支持:微信的线条样式,支付宝的网格样式。几句代码轻松拥有扫码功能 ,ZXingLite让集成更简单。(扫码识别速度快如微信)
https://jenly1314.github.io/ZXingLite/
Apache License 2.0
3.03k stars 470 forks source link

onScanResultCallback return false (app closes) #212

Closed Agmcz closed 1 year ago

Agmcz commented 1 year ago

I'm trying to qr scan single, but app closes!!!

mCameraScan.setOnScanResultCallback(new CameraScan.OnScanResultCallback() { @Override public boolean onScanResultCallback(Result result) { // some code return false; } });

jenly1314 commented 1 year ago

I'm trying to qr scan single, but app closes!!!

mCameraScan.setOnScanResultCallback(new CameraScan.OnScanResultCallback() { @OverRide public boolean onScanResultCallback(Result result) { // some code return false; } });

If you need to process the scan callback result, please intercept the callback and return true.

See OnScanResultCallback and scanResultCallback for details.

See CustomCaptureActivity for sample code.

Agmcz commented 1 year ago

Thank you for this hints, i used the following code to single scan

`// rescanning isContinuousScan = true; mCameraScan.setVibrate(true); mCameraScan.setPlayBeep(true);

mCameraScan.setOnScanResultCallback(new CameraScan.OnScanResultCallback() { @Override public boolean onScanResultCallback(Result result) { if (isContinuousScan) { isContinuousScan = false; mCameraScan.setVibrate(false); mCameraScan.setPlayBeep(false); // some code } return true; } });`