I have the code for the Camera2 from https://github.com/googlesamples/android-Camera2Basic.
The problem i\'m facing is that when i turn to my Front Camera, i cannot capt
@ArvindSingh's solution is not the best one, because you would also disable the focus functionality for the back camera. A better solution would be to do a camera facing check inside the takePicture like that:
private void takePicture() {
if (CameraCharacteristics.LENS_FACING_FRONT == mSelectedFacing) {
// front camera selected, so take a picture without focus
captureStillPicture();
} else {
// back camera selected, trigger the focus before creating an image
lockFocus();
}
}
For this solution you only need to save the current used facing somewhere like here in mSelectedFacing