While developing a camera app I\'ve encountered an exception that only happened when I switch to other app (onPause() for my app).
onPause()
01-15 17:22:1
@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.