I have a very annoyed error on the Galaxy S4 (another device works fine): when I turn on the flash, I can’t take a picture because it is onPictureTakenn’t called. Here is my attempt:
private void changeFlashMode(boolean isFlashOn) {
if (mCamera != null) {
Camera.Parameters camParameters = mCamera.getParameters();
camParameters.setFlashMode(isFlashOn ? Parameters.FLASH_MODE_ON : Parameters.FLASH_MODE_OFF);
mCamera.setParameters(camParameters);
startCameraPreview();
}
}
Debugging, I see that it is called on this line:
mCamera.takePicture(null, null, null, this);
and then nothing happened, onPictureTakennot called.
Could you give me an example?
source
share