title: Camera Intent Not Adding Extra
body: <p>I am using an implicit Intent to take a picture. I have been following the work outlined in this <a href="https://developer.android.com/training/camera/photobasics.html#TaskPath" rel="nofollow noreferrer">tutorial</a>. The issue that I am having is that the extra added to the Intent is not being delivered. Here is the code I'm using: </p>
  
  <pre><code>private void dispatchTakePictureIntent(Context context) {
          Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
          // Ensure that there's a camera activity to handle the intent
          if (takePictureIntent.resolveActivity(context.getPackageManager()) != null) {
              // Create the File where the photo should go
              File photoFile = null;
              try {
                  photoFile = createImageFile(this.getActivity());
              } catch (IOException ex) {
                  Log.e(TAG, "Error creating file: " + ex.toString());
                  //TODO: 2017/1/24 - Handle file not created
                  AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
                  builder.setTitle("Error")
                          .setMessage(ex.toString());
  
                  final AlertDialog dialog = builder.create();
                  dialog.show();
  
              }
              // Continue only if the File was successfully created
              if (photoFile != null) {
                  Uri photoURI = FileProvider.getUriForFile(context,
                          "com.example.myapp",
                          photoFile);
                  //THIS EXTRA IS NOT BEING ADDED TO THE INTENT
                  takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);
                  startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);
  
                  galleryAddPic(context, photoFile.getAbsolutePath());
              }
          }
      }
  </code></pre>
  
  <p>When the  <code>onActivityResult</code> method is fired, the <code>Intent</code> is empty. Here is that code:</p>
  
  <pre><code>@Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == REQUEST_TAKE_PHOTO &amp;&amp; resultCode == RESULT_OK) {
          //These extras are empty. I have used the debug tool, and there is nothing in here. 
          Bundle extras = data.getExtras();
          //extras is null
          imageBitmap = (Bitmap) extras.get("data");
          previewImage.setImageBitmap(imageBitmap);
      }
  }
  </code></pre>
  
  <p>Why is the intent empty? What do I need to do to fix this issue? </p>