From 40025180d3efaf8fd2ae17d17ea4c3bc810bd03f Mon Sep 17 00:00:00 2001 From: Paul Tirk Date: Tue, 3 Oct 2023 16:13:15 +0200 Subject: [PATCH] always assign new value to camera property --- .../main/java/com/ahm/capacitor/camera/preview/Preview.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/ahm/capacitor/camera/preview/Preview.java b/android/src/main/java/com/ahm/capacitor/camera/preview/Preview.java index 6daa426f..937ebcbf 100644 --- a/android/src/main/java/com/ahm/capacitor/camera/preview/Preview.java +++ b/android/src/main/java/com/ahm/capacitor/camera/preview/Preview.java @@ -62,8 +62,9 @@ class Preview extends RelativeLayout implements SurfaceHolder.Callback, TextureV } public void setCamera(Camera camera, int cameraId) { + mCamera = camera; + if (camera != null) { - mCamera = camera; this.cameraId = cameraId; mSupportedPreviewSizes = mCamera.getParameters().getSupportedPreviewSizes(); setCameraDisplayOrientation();