Android: Jak usunąć pliki z pamięci zewnętrznej?
Implementuję aplikację, która generuje i tworzy pliki w pamięci zewnętrznej. Czy możecie mi pomóc, jak możemy to usunąć?
Dziękuję, Chandra
Edytuj-1: Dodałem następujący kod i nadal mam ten sam problem, spójrz na mój kod poniżej,
String fullPath = "/mnt/sdcard/";
System.out.println(fullPath);
try{
File file = new File(fullPath, "audio.mp3");
if(file.exists()){
boolean result = file.delete();
System.out.println("Application able to delete the file and result is: " + result);
// file.delete();
}else{
System.out.println("Application doesn't able to delete the file");
}
}catch (Exception e){
Log.e("App", "Exception while deleting file " + e.getMessage());
}
W LogCat dostajęAplikacja zdolna do usunięcia pliku i wynik: false. Po wykonaniu tej czynności załączyłem zrzut ekranu. Proszę, spójrz na to. I zasugeruj mi.