title: null intent on onActivityResult when using MediaStore.EXTRA_OUTPUT for ACTION_IMAGE_CAPTURE
body: <p>I'm trying to retrieve a file from my ACTION_IMAGE_CAPTURE activity, but when I use</p>
  
  <pre><code>cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
  </code></pre>
  
  <p>I get a null intent on my activity result. Here is the full code.</p>
  
  <p>The intent</p>
  
  <pre><code>Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
  startActivityForResult(cameraIntent, 1888);
  </code></pre>
  
  <p>My onActivityResult</p>
  
  <pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data)
  {  
      if (requestCode == 1888 &amp;&amp; resultCode == RESULT_OK)
      {
          Uri uri = (Uri)data.getData();
          Intent i = new Intent(getApplicationContext(), Camara.class);
          i.putExtra("uri", uri);
          startActivity(i);
      }
  }
  </code></pre>
  
  <p>i'm using the following permissions</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &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>i need to access to the file of the image captured but i'm getting null on my parameter <code>data</code></p>
  
  <p>and then, How do I get the file? Like this?</p>
  
  <pre><code>File myfile = new File(uri.getPath());
  </code></pre>
  
  <p>I also tried this:</p>
  
  <pre><code>Uri uri = (Uri)data.getData();
  Intent i = new Intent(getApplicationContext(), Camara.class);
  i.putExtra("uri", uri);
  startActivity(i);
  </code></pre>
  
  <p>In this case I can get the bitmap with this</p>
  
  <pre><code>Bitmap lafoto = MediaStore.Images.Media.getBitmap(this.getContentResolver(), uri);
  </code></pre>
  
  <p>but i can't get the File </p>
  
  <p>I tried to follow this solution but didn't work for me <a href="https://stackoverflow.com/questions/4184951/get-path-of-image-from-action-image-capture-intent">Get Path of image from ACTION_IMAGE_CAPTURE Intent</a></p>