0

I am getting this error

java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=22206, uid=10073 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()

although that I added this permission into the manifest

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

and this is my code where cause the error

            Cursor c = getApplicationContext().getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, new String[]{BaseColumns._ID}, null, null, null);

How to fix this?

asmgx
  • 7,328
  • 15
  • 82
  • 143

0 Answers0