外部ストレージにファイルを生成および作成するアプリケーションを実装しています。どうすればそれを削除できますか?
編集
次のコードを追加しましたが、それでも同じ問題が発生します。以下の私のコードを参照してください:
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());
}
LogCat で、アプリケーションがファイルを削除できるようになり、結果は is:false になります。これを実行した後のスクリーンショットを添付しました。