title: SecurityException Permission Denial MediaProvider READ_EXTERNAL_STORAGE
body: <p>i am making gallery.</p>
  
  <p>i got below exception</p>
  
  <pre><code>Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=23769, uid=10470 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
  </code></pre>
  
  <p>I added permission </p>
  
  <pre><code>  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"  /&gt;
  </code></pre>
  
  <p>in my AndroidMainfest</p>
  
  <p>my code is below :</p>
  
  <pre><code>  Cursor localCursor = MediaStore.Images.Media.query(getContentResolver(), uri, mQuery);
  </code></pre>
  
  <p>i using nexus 5 (android ver 6.0)
  help!!</p>