Possible Duplicate:
How to delete a file from SD card?
This should be simple for most people, I want to know how to delete a file in the SD card (/sdcard/folder
) if it exists i.e?
Try this:
File folder = Environment.getExternalStorageDirectory();
string fileName = folder.getPath() + "/folder/image1.jpg";
File myFile = new File(fileName);
if(myFile.exists())
myFile.delete();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With