method called after release() exception unable to resume with android camera
I've got the same problem. mCamera.setPreviewCallback(null);
didn't help. In my activity I've added this to releaseCamera
:
mPreview.getHolder().removeCallback(mPreview);
and it works now.
@ookami.kb solution worked for me too, as well as @srunni commented.
public void onPause() {
super.onPause();
if (mCamera != null) {
mCamera.setPreviewCallback(null);
mPreview.getHolder().removeCallback(mPreview);
mCamera.release();
}
}
I removed onDestroy method too.
The docs clearly say that camera.release()
releases all camera resources. After this call camera reference can not be used any more.
If you want to use camera again you have to acquire it via a open(int)
method.
It's all described in the camera docs.