I am trying to delete a file on an external SD storage in android by using the following code:
filename = "/storage/extSdCard/AAA/testtitle.mp3"
File file = new File(filename)
file.delete()
I am also using the two permissions
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
in the Manifest
(outside the application declaration), and I am using the code suggested here. The device does not seem to be a Marshmellow device (first answer), and the suggested solution in the third answer also does not help. I still get the same error:
remove failed: EACCES (Permission denied) : /storage/extSdCard/AAA/testtitle.mp3
What else can I try?