delete file in android througn command code example
Example 1: android studio delete text file
File dir = getFilesDir();
File file = new File(dir, "my_filename");
boolean deleted = file.delete();
Example 2: delet file from path android
File fdelete = new File(uri.getPath());
if (fdelete.exists()) {
if (fdelete.delete()) {
System.out.println("file Deleted :" + uri.getPath());
} else {
System.out.println("file not Deleted :" + uri.getPath());
}
}