Android Question What is the right way to delete a file under a shared folder such as the DOWDLOAD folder on api 33?

Hi, everyone,
Since I only recently learned that Google has strictly changed the permission policy for reading and writing to external storage starting from a certain api version (Forgive me that my impression of Android internal and external storage is still stuck in a decade or so ago), I started to try to use SaveAs, ContentChooser, FileHandler, etc. introduced by Erel to deal with reading from and writing to files. (SaveAs - Let the user select a target folder + list of other related methods)

Now I basically have some concept about creating and reading files using these classes or libraries, but I still don't quite understand how to delete them under api33. Specifically, if my app creates a file in the DOWNLOAD directory, how should I delete it?

Thanks.
 
Solution
You can delete files with ExternalStorage.DeleteFile. This will however require the user to first select the Downloads folder.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…