public static boolean deletePictureCache() { String thumbnailPath = SDCARD_PATH + File.separator + PICTURE_THUMBNAIL; String middlePath = SDCARD_PATH + File.separator + PICTURE_BMIDDLE; String oriPath = SDCARD_PATH + File.separator + PICTURE_LARGE; deleteDirectory(new File(thumbnailPath)); deleteDirectory(new File(middlePath)); deleteDirectory(new File(oriPath)); return true; }
private static boolean deleteDirectory(File path) { if (path.exists()) { File[] files = path.listFiles(); if (files == null) { return true; } for (int i = 0; i < files.length; i++) { if (files[i].isDirectory()) { deleteDirectory(files[i]); } else { files[i].delete(); } } } return (path.delete()); }