CameraFragment
CameraFragment copied to clipboard
Unable to capture multiple photos (Live view changes to preview)
I want to take multiple photos at once without previewing the image. But on taking 1st picture live view changes to preview mode and if i capture the picture again app crashes.
I am suffering from this issue, right now I am recreating the Camera Fragment but this cause a black screen appear for 2 or 3 seconds
m doing the same. but i don't want that
if you solve the issue. please update me
You have to change Camera1Manager.java to continue showing preview.
camera.startPreview();
public void takePhoto(File photoFile, final CameraPhotoListener cameraPhotoListener, final CameraFragmentResultListener callback) {
this.outputPath = photoFile;
this.photoListener = cameraPhotoListener;
EventBus.getDefault().post(new RecordStateEvent(RecordStateEvent.State.Photo));
backgroundHandler.post(new Runnable() {
@Override
public void run() {
setCameraPhotoQuality(camera);
try {
camera.takePicture(null, null, new Camera.PictureCallback() {
@Override
public void onPictureTaken(byte[] bytes, Camera camera) {
Camera1Manager.this.onPictureTaken(bytes, camera, callback);
camera.startPreview();
}
});
} catch (Exception e) {
Log.e(TAG, "takePhoto error: "+e.getMessage()+" (usually caused by a double tap on photo trigger)");
if(cameraPhotoListener!=null)
cameraPhotoListener.onPhotoTakeError();
}
}
});
}