问题
I am using CameraManager and CameraCharacteristics
I would like to know how to check if the flashlight is turned on
回答1:
Try this bit of code
public boolean FlashStatus() {
Camera.Parameters parameters = camera.getParameters();
if (parameters.getFlashMode() == "FLASH_MODE_TORCH") {
return true;
}
if (parameters.getFlashMode() == "FLASH_MODE_OFF") {
return false;
}
}
来源:https://stackoverflow.com/questions/38827344/android-how-to-know-if-flashlight-is-on