title: Permission Denial: requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() (API 23)
body: <p>I am trying to request user permissions at runtime. The API is 23 and I want to pick up an image from the phone's gallery. Following some snippets, this is the code I have so far: </p>
  
  <p>In the <code>onCreate()</code> of the Activity I check:</p>
  
  <pre><code>if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) !=
              PackageManager.PERMISSION_GRANTED) {
          imageUploader5.setEnabled(true);
          ActivityCompat.requestPermissions(this, new String[]
                  { Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE }, 0);
      }
  </code></pre>
  
  <p>Then I override:</p>
  
  <pre><code>@Override
  public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
      if (requestCode == 0) {
          if (grantResults.length &gt; 0 &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED
                  &amp;&amp; grantResults[1] == PackageManager.PERMISSION_GRANTED) {
              imageUploader5.setEnabled(true);
          }
      }
  }
  </code></pre>
  
  <p>But I still cannot make the app to run on the AVD.</p>
  
  <p>EDIT: Permissions in the manifest:</p>
  
  <pre><code>&lt;uses-permission-sdk-23 android:name="android.permission.CAMERA" /&gt;
  &lt;uses-permission-sdk-23 android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission-sdk-23 android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  </code></pre>