android - How to delete a whole folder and content? -
i want users of application able delete dcim folder (which located on sd card , contains subfolders).
is possible, if how?
let me tell first thing cannot delete dcim folder because system folder. delete manually on phone delete contents of folder, not dcim folder. can delete contents using method below:
updated per comments
file dir = new file(environment.getexternalstoragedirectory()+"dir_name_here"); if (dir.isdirectory()) { string[] children = dir.list(); (int = 0; < children.length; i++) { new file(dir, children[i]).delete(); } }
Comments
Post a Comment