camera image is not saving in sdcard and not display in imageview in front camera in android
<p>I am using front camera to take picture and dispaly it in image view .but image is not captured using frontface camera in samsung galaxy tab  can anybody tell what is problem even i had given  set picture format.I used getoptimalpreview size for preview size.can anybody tell anything i missed? preview is coming properly but click take picture background is black</p>

<pre><code>mCamera = Camera.open();
Parameters params = mCamera.getParameters();
params.set("camera-id", 2);
params.setPictureFormat(PixelFormat.JPEG);
</code></pre>

<p>saving and setting display in imageview </p>

<pre><code>public void onPictureTaken(byte[] data, Camera camera)
{
Bitmap bmp = BitmapFactory.decodeByteArray(data, 0, data.length);
imv.setImageBitmap(bmp);
String filename = "vijaypicture.jpg";
File pictureFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + filename);
try
{
FileOutputStream pfos = new FileOutputStream(pictureFile);
bmp.compress(CompressFormat.JPEG, 75, pfos);
pfos.flush();
pfos.close();
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
}
</code></pre>
