Java tutorial
//package com.java2s; import android.os.Environment; import java.io.File; public class Main { public static String workingDirectory = Environment.getExternalStorageDirectory().getAbsolutePath() + "/BSDImage"; public static void deleteContentWorkingDirectory() { deleteDirectoryContent(workingDirectory); } private static void deleteDirectoryContent(String directoryPath) { File dir = new File(directoryPath); if (dir.exists() && dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { File file = new File(dir, children[i]); if (file.isDirectory()) { deleteDirectoryContent(file.getAbsolutePath()); } else { file.delete(); } } dir.delete(); } } }