ContextWrapper cw = new ContextWrapper(getApplicationContext());
File myFile = cw.getDir("mydata", Context.MODE_PRIVATE);
Now please tell me how to remove whatever contains(mainly images) myFile(folder), how to clear it?
ContextWrapper cw = new ContextWrapper(getApplicationContext());
File myFile = cw.getDir("mydata", Context.MODE_PRIVATE);
Now please tell me how to remove whatever contains(mainly images) myFile(folder), how to clear it?
PrintWriter pw = new PrintWriter("fileName.txt");
pw.close();
OR
new RandomAccessFile(fileName).setLength(0);
Easiest way to clear a folder is by recursion:
void deleteDirContent(File file) {
if (file.isDirectory()) {
for (File child : file.listFiles())
deleteDirContent(child); <--------
}
file.delete();
}