Pictures saved on sdcard on android
<p>I had a problem when saving picture on sdcard from my app.
that when i am taking a picture and saving it on sdcard and go to my app and take a new one and save it on sdcard the previous preview picture appear and when view it on my computer it appear corrupted ?</p>

<p>why this problem ?</p>

<pre><code>public static void save(Bitmap bm, String path) {
    OutputStream outStream = null;

    try {
        outStream = new FileOutputStream(new File(path));
        bm.compress(Bitmap.CompressFormat.JPEG, 100, outStream);
        outStream.flush();
        outStream.close();

        bm.recycle();
        System.gc();

    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
}

enter code here
</code></pre>
