I am trying to save a camera captured image on the device. But it does not get saved.

//---manifest

```
<uses-permission android:name="ANDROID.PERMISSION.CAMERA" />
<uses-permission android:name="ANDROID.PERMISSION.WRITE_EXTERNAL_STORAGE" />

```

I use the following code:

```
    if (resultCode == RESULT_OK) {
        if (requestCode == CAMERA_REQUEST) {
            Bitmap thumbnail = (Bitmap) data.getExtras().get("data");
            ByteArrayOutputStream bytes = new ByteArrayOutputStream();
            thumbnail.compress(Bitmap.CompressFormat.JPEG, 90, bytes);

            try {
                Bitmap photo = (Bitmap) data.getExtras().get("data");
                File outFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath(), "myimage.jpg");
                FileOutputStream fos = new FileOutputStream(outFile);
                photo.compress(Bitmap.CompressFormat.JPEG, 100, fos);

                fos.flush();
                fos.close();
                getImages();

```