Method called after release Exception Camera preview

前端 未结 7 1316

I have one activity class(CameraActivity) which is using my CameraPreview class. In \"OnResume\" the camera and preview are initiated. In \"OnPause\", i am releasing camera

7条回答
  •  醉梦人生
    2020-12-13 12:00

    I had a similar problem with my code which was force closing with the Method called after release() error.

    I was calling a SetupCamera() method in OnResume()which checked for a null camera object and then called camera.Open().

    What fixed my problem was to get rid of the null-check and just call camera.Open() whether it was null or not (I had already set camera = null on onPause) after reading the Camera Docs.

    I know this is not definitive in tracking down my problem, but it absolutely worked for me!

提交回复
热议问题