Skip to content

Instantly share code, notes, and snippets.

@jinqian
Created March 19, 2014 16:50
Show Gist options
  • Select an option

  • Save jinqian/9646004 to your computer and use it in GitHub Desktop.

Select an option

Save jinqian/9646004 to your computer and use it in GitHub Desktop.
delete file in fir directory
String fn = "filename_pattern";
File dir = getFilesDir();
for (File f : dir.listFiles()) {
if (f.getName().contains(fn)) {
f.delete();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment