Releasing The Camera: "method Called After Release()" Exception
I'm trying to incorporate some camera-related features in my app. I open the camera manually and get the preview stream with setPreviewCallback and startPreview. I do not use the s
Solution 1:
The preview callback could cause this exception. onPreviewFrame()
is not synchroneous, and it receives a Camera parameter that may become invalid when Camera.release()
is performed. This could happen even if callbacks are not using a separate thread (highly recommended).
Before release()
, call setPreviewCallback(null)
, and keep a global flag to discard callbacks after the camera is released.
Post a Comment for "Releasing The Camera: "method Called After Release()" Exception"