title: getting bitmap from uri not working
body: <p>whenever i try to get uri from Intent which just select an image from image picker its not working here is my code. Please answer ASAP</p>
  
  <pre><code>@Override
      public boolean onOptionsItemSelected(MenuItem item) {
  
          int id = item.getItemId();
  
          if (id == R.id.share) {
  
              Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
              i.setType("image/*");
              startActivityForResult(i, 1);
  
  
          } else if (id == R.id.logOut) {
              ParseUser.logOut();
              Intent i = new Intent(this, MainActivity.class);
              startActivity(i);
          }
          return super.onOptionsItemSelected(item);
      }
  
      @Override
      protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
  
          if (requestCode == 1 &amp;&amp; resultCode == Activity.RESULT_OK &amp;&amp; data!=null) {
  
              try {
  
                  Uri selectedImage = data.getData();
  // this is the line which is causing error
  
                  Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), selectedImage);
                  ByteArrayOutputStream stream = new ByteArrayOutputStream();
                  bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
                  Toast.makeText(getApplication().getBaseContext(),"test",Toast.LENGTH_LONG).show();
  
              } catch (Exception e) {
                  e.printStackTrace();
              }
  
          }
  }
  </code></pre>
  
  <p>and this is logs:
  I/Error: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/27 from pid=5506, uid=10043 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()</p>
  
  <p>permission already given are:
    uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"</p>
  
  <p>Note:can't use proper tags for uses-permisson here because stackover flow giving error</p>
  
  <p>Manifest file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
  
  &lt;application
      android:allowBackup="true"
      android:icon="@mipmap/ic_launcher"
      android:label="Share Pics"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"&gt;
      &lt;meta-data
          android:name="com.parse.APPLICATION_ID"
          android:value="X6I00RcSXvAnvvV8iaR6ftEsHo2o7sHXmzkZlb03" /&gt;
      &lt;meta-data
          android:name="com.parse.CLIENT_KEY"
          android:value="MyKnxnrPXRan1z56fpSmkxPx7hgcM44NfvzdC4q5" /&gt;
  
      &lt;activity android:name=".MainActivity"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity android:name=".UserList" /&gt;
      &lt;activity
          android:name=".UsersFeed"
          android:label="@string/title_activity_users_feed"
          android:parentActivityName=".UserList"
          android:theme="@style/AppTheme.NoActionBar"&gt;
          &lt;meta-data
              android:name="android.support.PARENT_ACTIVITY"
              android:value="com.anshuman.myinstagram.UserList"/&gt;``
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>