Instantly share code, notes, and snippets.

What would you like to do?
Flash Light On Method on the SSaurel's Blog
private void flashLightOn() {
CameraManager cameraManager = (CameraManager) getSystemService(Context.CAMERA_SERVICE);
try {
String cameraId = cameraManager.getCameraIdList()[0];
cameraManager.setTorchMode(cameraId, true);
flashLightStatus = true;
} catch (CameraAccessException e) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment