Created
October 19, 2017 12:37
-
-
Save ssaurel/2f709bbabca32e718606643ef2a90aac to your computer and use it in GitHub Desktop.
Flash Light Off Method on the SSaurel's Blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void flashLightOff() { | |
CameraManager cameraManager = (CameraManager) getSystemService(Context.CAMERA_SERVICE); | |
try { | |
String cameraId = cameraManager.getCameraIdList()[0]; | |
cameraManager.setTorchMode(cameraId, false); | |
flashLightStatus = false; | |
imageFlashlight.setImageResource(R.drawable.btn_switch_off); | |
} catch (CameraAccessException e) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment