title: Cropped image from the image picker
body: <p>I am trying to get a cropped image from the image picker. I can choose an image and see the cropped rectangle. But after cropping returned to my activity, my <code>uri</code> is always null... "onActivityResult" will not be called.</p>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>        iv.setOnClickListener(new View.OnClickListener(){
              @Override
              public void onClick(View view) {
                  Intent pickImageIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
  
                  int imageX = iv.getMeasuredWidth();
                  int imageY = iv.getMeasuredHeight();
  
                  pickImageIntent.setType("image/*");
                  pickImageIntent.putExtra("crop", "true");
                  pickImageIntent.putExtra("outputX", imageX);
                  pickImageIntent.putExtra("outputY", imageY);
                  pickImageIntent.putExtra("aspectX", imageX);
                  pickImageIntent.putExtra("aspectY", imageY);
                  pickImageIntent.putExtra("scale", true);
                  pickImageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
                  startActivityForResult(pickImageIntent,REQ_CODE_PICK_GALLERY);
              }
          });
  </code></pre>
  
  <p><strong>also calling</strong></p>
  
  <pre><code>pickImageIntent.putExtra("return-data", true);
  </code></pre>
  
  <p><strong>or</strong></p>
  
  <pre><code>@Override
      protected void onResume(){
          super.onResume();
          iv.setImageURI(uri);
      }
  </code></pre>
  
  <p>does not work either...</p>
  
  <p><strong>These are my permissions:</strong></p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  </code></pre>
  
  <p><strong>I also tried:</strong></p>
  
  <pre><code>pickImageIntent.putExtra("outputFormat", Bitmap.CompressFormat.PNG.toString());
  pickImageIntent.putExtra("return-data", true);
  </code></pre>
  
  <p>and get the bitmap in <code>onActivityResult</code> works, but the <code>imagesize</code> is too small. It feels like </p>
  
  <pre><code>pickImageIntent.putExtra("outputX", imageX);
  pickImageIntent.putExtra("outputY", imageY);
  </code></pre>
  
  <p>is being ignored, what can I do?</p>