I have a few zero-byte files in my app folder inside the sdcard which I am not able to delete.
final String path = Environment.getExternalStorageDirectory().getAbsolutePath()+"/"+"AppFolder"+"/"+"Music";
File file=new File(path,filee);
if(file.exists())
{
boolean delete=file.delete();
Log.d("TAG",""+delete);
}
‘filee’ here is the name of the file(.mp3).This code does not work as technically the file does not exist.
Does anybody know how to solve this?
The code should be ok:
First, please check with the permission and make sure you have this permission:
And your path should be something like this: