I am obtaining a URI of an image from an SQLite database in my application and then trying to add the image from that URI to a gridview using my adapter.
I am getting an exception asking for MANAGE_DOCUMENTS permission however, I added it in the android manifest yet still getting the exception.
The exception pops up when trying to open the InputStream
InputStream in = cr.openInputStream(Uri.parse(r.getPostImageURL()));
This is the snippet from my manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.androidtutorial1" android:versionCode="1" android:versionName="1.0" >
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
The full error:
java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaDocumentsProvider uri content://com.android.providers.media.documents/document/image%3A46937 from pid=1399, uid=10350 requires android.permission.MANAGE_DOCUMENTS, or grantUriPermission()