美文网首页Android
切换摄像头时Camera is being used after

切换摄像头时Camera is being used after

作者: 梧叶已秋声 | 来源:发表于2018-04-12 16:12 被阅读2313次

    /** * 释放摄像头资源 */  

    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

    相关文章

      网友评论

        本文标题:切换摄像头时Camera is being used after

        本文链接:https://www.haomeiwen.com/subject/qpjghftx.html