android - How to delete a file that exists -


possible duplicate:
how delete file sd card?

this should simple people, want know how delete file in sd card (/sdcard/folder) if 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(); 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -