google / cameraview

[DEPRECATED] Easily integrate Camera features into your Android app
Apache License 2.0
4.74k stars 1.03k forks source link

Just Turn ON Flash Light without capturing #248

Closed amira133 closed 2 years ago

amira133 commented 5 years ago

Hello I want to know how turn on flash light without taking picture. Or set it to turn On flash light all the time.

Thank..

luisburgos commented 5 years ago

One way you could interact with the flash light is by using the method CameraView#setFlash(int):

cameraView.setFlash(CameraView.FLASH_TORCH);

Note: Be sure to use CameraView.FLASH_TORCH instead of CameraView.FLASH_ON to force the flash light to be on all the time.