java.lang.RuntimeException: Fail to Connect to camera service

后端 未结 4 1681
执笔经年
执笔经年 2020-12-06 18:02

I tried to make an app than can switch my camera flash on and off. The code I have atm looks like this:

Camera flash;
Camera.Parameters params;

flash = Came         


        
4条回答
  •  眼角桃花
    2020-12-06 18:32

    You might have forgotten to call release in onDestroy

    For example:

    @Override
    protected void onDestroy() {
        if (mCamera != null) {
            mCamera.release();
        }
        super.onDestroy();
    }
    

提交回复
热议问题