문제

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()
도움이 되었습니까?

해결책

look into the following..

Getting Permission Denial Exception

Android KitKat securityException when trying to read from MediaStore

they also have same prob..hope it will helps you.

다른 팁

Have you checked the required api for the kind of request I suggest you use minSdk as 9 or 8 and maxSdk as 19.Hope this works

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top