Code example for Camera

Methods: getParameterssetParameters

1
	 *  
	 * @param state			The requested state 
	 *  
	 */ 
	protected void toggleTorch(boolean state) {
		mParameters = mCamera.getParameters();
 
		// Make sure that torch mode is supported 
		// 
		if ( this.isCapable() ) {
			if (state) {
				mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_TORCH);
			} else { 
				mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_ON);
			} 
 
			// Commit the camera parameters 
			// 
			mCamera.setParameters(mParameters);
 
			mbTorchEnabled = state;
		} 
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java