From 633b5f7b548f112e20b7a155a67fe19c9305494a Mon Sep 17 00:00:00 2001 From: PaoloMessina Date: Tue, 3 Feb 2015 10:43:31 +0100 Subject: [PATCH] Manage onAutoFocus Android Manage onAutoFocus Android --- android/ZBarScannerActivity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/android/ZBarScannerActivity.java b/android/ZBarScannerActivity.java index bb50989..7566840 100644 --- a/android/ZBarScannerActivity.java +++ b/android/ZBarScannerActivity.java @@ -294,8 +294,12 @@ implements SurfaceHolder.Callback { private AutoFocusCallback autoFocusCb = new AutoFocusCallback() { public void onAutoFocus(boolean success, Camera camera) { - camera.cancelAutoFocus(); - autoFocusHandler.postDelayed(doAutoFocus, autoFocusInterval); + try{ + camera.cancelAutoFocus(); + autoFocusHandler.postDelayed(doAutoFocus, autoFocusInterval); + }catch(Exception e){ + + } } };