google / cameraview

[DEPRECATED] Easily integrate Camera features into your Android app
Apache License 2.0
4.74k stars 1.03k forks source link

set flash on and take a photo ,then auto focus can not work #232

Open ryetal opened 6 years ago

ryetal commented 6 years ago

s6 and use camera1. when I turn on flash and take a photo ,then auto focus can not restore . I modify Camera1.java : void takePictureInternal() { if (!isPictureCaptureInProgress.getAndSet(true)) { mCamera.takePicture(null, null, null, new Camera.PictureCallback() { @Override public void onPictureTaken(byte[] data, Camera camera) { isPictureCaptureInProgress.set(false); mCallback.onPictureTaken(data); camera.cancelAutoFocus(); camera.startPreview();

                mCamera.setParameters(mCameraParameters);  //add this line and work well,but I dont know why?
            }
        });
    }