How to delete a bitmap image which is stored on the sd card in android
<p>In my application I have a grid view of images and when a user clicks an image then it will open the image in fullscreen.  The images are loaded from the SD card as follows:</p>

<pre><code>File sdDir = new File("mnt/sdcard/Pictures");
File[] sdDirFiles = sdDir.listFiles();
for(File singleFile : sdDirFiles) {
    String filePath = singleFile.getAbsolutePath();
Bitmap bmp = scaleBitmap(filePath);
photos.add(bmp);
}
mThumbIds = photos.toArray(new Bitmap[(photos.size())]);
</code></pre>

<p>}</p>

<p>Scale bitmap is a method which decodes each file into a bitmap and then scales the bitmap before returning it.</p>

<p>I then have another Activity which loads the images fullscreen once they have been clicked.  I have a menu button "Delete", from which I would like to delete the file on the sdcard which represents the bitmap I see on the screen.</p>

<p>The problem I have is that there is no way to get the file name from the Bitmap object, so therefore I cannot delete the file.</p>

<p>Any help will be greatly appreciated.</p>
