code-scanner
code-scanner copied to clipboard
Flash light not working in MIUI Android 10
I have implemented this lib working fine but only with MI device, it's not working and nothing error shows in logs.
I found something in this. same device when try to turn on/off flash using lib it's not working. but when try to turn on/off flash using camera2 API it's working.
Hi Guys, I'm also facing the issue which was mentioned by @vivekbdc .
Error : System.err: android.hardware.camera2.CameraAccessException: CAMERA_IN_USE (4): setTorchMode:2315: Torch for camera "0" is not available due to an existing camera user
Reproducing Method:
- After Implemented the code scanner codes. Scanner screen will open. We have to rise the camera's runtime permissions for scanning the qr code. I'm done this.
- QR codes are scanned well.
- Now I will try to open the flash light. Its not working and getting the following error. " System.err: android.hardware.camera2.CameraAccessException: CAMERA_IN_USE (4): setTorchMode:2315: Torch for camera "0" is not available due to an existing camera user"
- After this I have denied the camera permission. No we cannot scan the QR code the screen should be in black color. Now flash light working fine.
Try to Give a solution asap.
Thanks in advance!