I'm writeing an XML file in android and I want to let the user select a folder, in the local storage( or SD card)
So i'm using this Intent:
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE);
startActivityForResult(intent, READ_REQUEST_CODE);
everything work quite well, on "onActivityResult" method i'm getting this to get the folder choosed by the user:
final String path = data.getDataString();
but I get this:
content://com.android.providers.downloads.documents/tree/downloads
And when I continue and try to write I get this error:
Caused by: java.io.FileNotFoundException:
content:/com.android.providers.downloads.documents/tree/downloads/ATMob_Export_2019-06-03_16-29-01.zip
I suppose that I'll receive something like :
/storage/emulated/0/download
Any idea ?
Best Regards