I have a PreferenceFragment that implements a custom Preference that I've extended. It launches an intent that returns a selected image from the filesystem. Everything works fine, mostly. The Preference sets the image thumbnail in the preferences view and grabs the display name to set as the preference summary. The URI string persists as it should. However, When the preference screen initializes, it fails to retrieve either the display name or the image resource due to a permissions error.
Unable to open content: content://com.android.providers.downloads.documents/document/125
java.lang.SecurityException: Permission Denial: opening provider com.android.providers.downloads.DownloadStorageProvider from ProcessRecord{80311e3 16941:com.companyXXX.appnameXXX/u0a87} (pid=16941, uid=10087) requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs
I can post the code if anyone wants it. I am sure I have pinpointed the problem, but I am not sure how to add permissions to the ImageView.setImageUri() resource access.
This is not a duplicate of How to ask permission to access gallery on android M.? as I have permissions for the initial file selection. THAT WORKS JUST FINE.
hoping someone out there is familiar with this issue and can provide a solution.