Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Unable to read file in Documents folder while able to read file in Download folder

$
0
0

I came across a strange issue where I wanted to read a file (for example, a text file) from the Documents folder. I was obtaining the path to this folder like so:

Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDocuments).AbsolutePath

but it would always fail (could not locate the file). At the same time, I could read the same text file from the Download folder with:

Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDownloads).AbsolutePath

I have permissions defined in the manifest to allow for reading/writing, so I'm not sure why it fails on the Documents folder. Anyone run into this before?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>