Code example for Camera.Parameters

Methods: getSupportedFlashModes, setFlashMode

0
	protected void onResume() { 
		super.onResume(); 
		 
		// turn light on 
		Parameters parameters = camera.getParameters();
		List<String> supportedModes = parameters.getSupportedFlashModes();
		if (supportedModes == null) {
			userMessages.showAlways("This device have no flash or it is not accesible by API");
			return; 
		} 
		if (supportedModes.contains(Parameters.FLASH_MODE_TORCH)) {
			parameters.setFlashMode(Parameters.FLASH_MODE_TORCH);
			camera.setParameters(parameters);
		} else 
			userMessages.showAlways("Torch mode is not supported by this device");
	} 
	 
	@Override 
	protected void onPause() { 
		super.onPause();