/** * 释放摄像头资源 */
private void freeCameraResource() {
if (mCamera != null) {
mCamera.setPreviewCallback(null);
mCamera.stopPreview();
mCamera.lock();
mCamera.release();
mCamera =null;
}
}
我之前漏了一句 mCamera.setPreviewCallback(null); 导致报错。
参考链接:
java.lang.RuntimeException: Camera is being used after Camera.release() was called
https://blog.csdn.net/Stromg_zzp/article/details/52196520
网友评论