title: onActivityResult returns with data = null
body: <p>Ok so this here is the intent I am sending</p>
  
  <pre><code>Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a file to save the image
  intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name
  startActivityForResult(intent, REQUEST_CODE);
  </code></pre>
  
  <p>And then in the onActivityResult I am doing this:</p>
  
  <pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          Log.i("Intent name:",data.toString());
          if (requestCode == REQUEST_CODE){
              if (resultCode == Activity.RESULT_OK){
                  Toast.makeText(this, "Image saved to \n" + fileUri.toString() , Toast.LENGTH_LONG).show();
                  Toast.makeText(this, "Result Code: " + resultCode , Toast.LENGTH_LONG).show();
                  //Bitmap mBitMap = BitmapFactory.decodeFile(data.getData().toString());
                  //imageView.setImageBitmap(mBitMap);
              }
              else if (resultCode == RESULT_CANCELED){
                  Toast.makeText(this, "Capture Cancelled", Toast.LENGTH_LONG).show();
              }
              else {
                  Toast.makeText(this, "Capture failed", Toast.LENGTH_LONG).show();
              }
  
          }
  
          super.onActivityResult(requestCode, resultCode, data);
      }  
  </code></pre>
  
  <p>The LogCat is showing a NullPointerException at the line that says Image Saved....<br>
  And also this:<br>
  <code>java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=100, result=-1, data=null}</code>  </p>
  
  <p>This happens whether i try to use the <code>data</code> object or the <code>fileUri</code> field of my class.<br>
  Why is data being returned <code>null</code>?<br>
  Why is it that even though I am using a field of the class i still get the same error?</p>