Android

Tuesday, 7 October 2014

delete particular file and sub files in android ?

public static void deleteFile(File f) {
String[] flist = f.list();
for (int i = 0; i < flist.length; i++) {
File temp = new File(f.getAbsolutePath() + "/" + flist[i]);
if (temp.isDirectory()) {
deleteFile(temp);
temp.delete();
} else {
temp.delete();
}
}
f.delete();
}

Posted by Unknown at 06:56
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2019 (1)
    • ►  June (1)
  • ►  2016 (5)
    • ►  June (5)
  • ►  2015 (14)
    • ►  October (1)
    • ►  July (1)
    • ►  June (2)
    • ►  May (3)
    • ►  April (2)
    • ►  March (2)
    • ►  February (3)
  • ▼  2014 (43)
    • ►  December (1)
    • ►  November (4)
    • ▼  October (10)
      • how to sort data in array list in android ?
      • Paypal integration in android ?
      • scroll up and down animation in android ?
      • water drop animations /circular ripple animations ...
      • how to use restful service calls in android ?
      • How to get the face book groups in android ?
      • How to get the facebook friend albums in android ?
      • delete particular file and sub files in android ?
      • how to write Custom toast in android ?
      • sections listview/gridview in android ?
    • ►  August (6)
    • ►  June (19)
    • ►  May (3)
  • ►  2013 (32)
    • ►  May (32)
Watermark theme. Theme images by friztin. Powered by Blogger.