Create a gist now

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;
imageFlashlight.setImageResource(R.drawable.btn_switch_on);
} catch (CameraAccessException e) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment