Friends, there is such a moment. I need to find out the path to the Downloads folder, if there is a flash drive then a flash drive, if not then the phone’s memory.
Folder Downloads from a flash drive, I take this code:
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) But on Sony Z2, this method does not work and I think there are many phones where this method does not work. (on the Sony Z2 flash drive was).
But, if there is no flash drive, how can I get the Downloads path on the phone's memory?
I need to download a PDF file to this directory, if I download to another location, the PDF Reader cannot open this file, although I check the directory for .canRead and .canWrite
There are many solutions on the Internet with the definition of a flash drive on different phones, but I did not find a normal solution.