Android examples for File Input Output:Directory
delete File And Folder
//package com.java2s; import java.io.File; public class Main { private static void deleteFileAndFolder(File fileOrFolder) { if (fileOrFolder == null || !fileOrFolder.exists()) { return; }//w ww. jav a2 s . c om if (fileOrFolder.isDirectory()) { File[] children = fileOrFolder.listFiles(); if (children != null) { for (File childFile : children) { deleteFileAndFolder(childFile); } } } else { fileOrFolder.delete(); } } }