Browsing for a specifc file which I know exists and is usable
File Dialog gives me
Dir = /storage/emulated/0/download
and
filename = Myfile.OXS
Content Chooser gives me
Dir = ContentDir
Filename = content//com.android.externalstorage.documents/document/primary%3ADownload%2FMyfile.OXS
If I check for existence with
if File.exists(Dir,filename)
or try to open the file in any way using the values returned by Content Chooser, everything fails.
eg the exact same file 'exists' using the File Dialog values, but not if I use the values returned by Content Chooser
The forum is full of people asking 'how do I get the path to a file returned by Content Chooser', and the answer is nearly always 'dont try' and 'it just works - why do you need a file path?'
But since it doesn't, how do you use the values like the ones coming from Content Chooser to actually work with a file?
File Dialog gives me
Dir = /storage/emulated/0/download
and
filename = Myfile.OXS
Content Chooser gives me
Dir = ContentDir
Filename = content//com.android.externalstorage.documents/document/primary%3ADownload%2FMyfile.OXS
If I check for existence with
if File.exists(Dir,filename)
or try to open the file in any way using the values returned by Content Chooser, everything fails.
eg the exact same file 'exists' using the File Dialog values, but not if I use the values returned by Content Chooser
The forum is full of people asking 'how do I get the path to a file returned by Content Chooser', and the answer is nearly always 'dont try' and 'it just works - why do you need a file path?'
But since it doesn't, how do you use the values like the ones coming from Content Chooser to actually work with a file?
B4X:
if File.exists(Dir,filename)