Code example for Camera

Methods: autoFocus

0
 
  synchronized void start() { 
    if (useAutoFocus) {
      active = true;
      try { 
        camera.autoFocus(this);
      } catch (RuntimeException re) {
        // Have heard RuntimeException reported in Android 4.0.x+; continue? 
        Log.w(TAG, "Unexpected exception while focusing", re);
      } 
    } 
  } 
 
  synchronized void stop() { 
    if (useAutoFocus) {
      try { 
        camera.cancelAutoFocus();
      } catch (RuntimeException re) {
        // Have heard RuntimeException reported in Android 4.0.x+; continue? 
        Log.w(TAG, "Unexpected exception while cancelling focusing", re);
      }