Photo not saving to phone memory
<p>I am using Android 4.03 on a Samsung Galaxy Nexus. The logs are showing that the file has been written to the phone memory, however when I check in windows explorer or using the phones gallery I cannot see the image that I have just taken a photo of. </p>

<p>Here is my code.</p>

<pre><code>    PictureCallback jpegCallback = new PictureCallback() {
    public void onPictureTaken(byte[] data, Camera camera) { 
        FileOutputStream outStream = null;
        boolean mExternalStorageAvailable = false;
        boolean mExternalStorageWriteable = false;
        String state = Environment.getExternalStorageState();
        if (Environment.MEDIA_MOUNTED.equals(state)) {
            // We can read and write the media
            mExternalStorageAvailable = mExternalStorageWriteable = true;
            Log.d(TAG, "Can Write ");
            try {

                outStream = new FileOutputStream(String.format("/sdcard/myfile.jpg", System.currentTimeMillis()));  

                outStream.write(data);
                outStream.close();



                Log.d(TAG, "onPictureTaken - wrote bytes: " + data.length);
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } finally {
            }

        } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
            // We can only read the media
            mExternalStorageAvailable = true;
            mExternalStorageWriteable = false;
            Log.d(TAG, "Cant Write ");
        } else {
            // Something else is wrong. It may be one of many other states, but all we need
            //  to know is we can neither read nor write
            mExternalStorageAvailable = mExternalStorageWriteable = false;
            Log.d(TAG, "Other Error ");
        }
            }
};
</code></pre>
