Fix tuto3 picture taken crash on all devices
A modification of the JavaCameraView is needed to avoid a crash when the app is exited. It is a good practice to remove the callback after the stopPreview method.
This commit is contained in:
@@ -179,6 +179,8 @@ public class JavaCameraView extends CameraBridgeViewBase implements PreviewCallb
|
||||
synchronized (this) {
|
||||
if (mCamera != null) {
|
||||
mCamera.stopPreview();
|
||||
mCamera.setPreviewCallback(null);
|
||||
|
||||
mCamera.release();
|
||||
}
|
||||
mCamera = null;
|
||||
|
Reference in New Issue
Block a user