I'm trying to load an image.. wel this works well when i using API 18 or lower, but if i use API 19 (Kitkat) a problem of security ocurrs... i'm not sure how to solve this, but the cursorloader throught me an exception. I read somenting like
http://developer.android.com/guide/topics/providers/document-provider.html#client
but without a good result. If you saw below i've a new path about the image file, so i can manage this?
*STACK_TRACE=java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaDocumentsProvider uri content://com.android.providers.media.documents/document/image%3A1384 from pid=3632, uid=10027 requires android.permission.MANAGE_DOCUMENTS, or grantUriPermission()*
CursorLoader cursorLoader = new CursorLoader(
context,
uri,
projection,
null, null, null);
Some permissions that i've in manifest
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS"/>
<uses-permission android:name="com.android.vending.BILLING" />
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…