Stephan
Stephan

Reputation: 59

Android how to know if flashlight is on

I am using CameraManager and CameraCharacteristics

I would like to know how to check if the flashlight is turned on

Upvotes: 4

Views: 1968

Answers (1)

Thom
Thom

Reputation: 323

Try this bit of code

public boolean FlashStatus() {
    Camera.Parameters parameters = camera.getParameters();
    return parameters.getFlashMode() == "FLASH_MODE_TORCH";
}

Upvotes: 3

Related Questions