i am creating an camera app which will set the flash to auto mode.i am using intent to launch the camera app.I tried the folllowing code but flash remains off
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
Camera cam = Camera.open();
Camera.Parameters p = cam.getParameters();
p.setFlashMode(Parameters.FLASH_MODE_AUTO);
cam.setParameters(p);
cam.startPreview();
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
// start the image capture Intent
startActivityForResult(cameraIntent,CAMERA_CAPTURE_IMAGE_REQUEST_CODE);