# HG changeset patch # User IBBoard # Date 1351511957 0 # Node ID de6a63e771dc0e8c811a8fe6d6109d1c77174fba # Parent 7bcf9621a373f69120db2d9524980796214a438e Code cleanup diff -r 7bcf9621a373 -r de6a63e771dc src/uk/co/ibboard/acetorch/AceTorchActivity.java --- a/src/uk/co/ibboard/acetorch/AceTorchActivity.java Mon Oct 29 11:38:59 2012 +0000 +++ b/src/uk/co/ibboard/acetorch/AceTorchActivity.java Mon Oct 29 11:59:17 2012 +0000 @@ -44,8 +44,8 @@ // 2) Sham's post (http://stackoverflow.com/a/10253946/283242 - auto-focus just after start preview) // 3) A reasonable amount of trial and error private void enableLight() { - initCamera(); + if (_camera == null) { Toast.makeText(this, "Unable to get camera", Toast.LENGTH_LONG); @@ -61,11 +61,7 @@ _camera.startPreview(); - _camera.autoFocus(null/*new AutoFocusCallback() { - public void onAutoFocus(boolean success, Camera camera) { - // Do nothing, just be a handler - } - }*/); + _camera.autoFocus(null); params = _camera.getParameters(); params.setFlashMode(Parameters.FLASH_MODE_OFF);