title: Pass extra intent after capturing image from camera
body: <p>I want to pass an extra intent after capturing an image from camera to identify which image I captured. For that I have,</p>
  
  <pre><code>int TAKE_PHOTO_CODE = 0;
  Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
  startActivityForResult(cameraIntent, TAKE_PHOTO_CODE);
  </code></pre>
  
  <p>On response,</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
      if (requestCode == TAKE_PHOTO_CODE &amp;&amp; resultCode == EditProfileActivity.RESULT_OK) {
          Log.d("CameraDemo", "Pic saved");
          // Get passed intent here...
          System.out.println("EXTRA INTENT: "+data.getStringExtra("profile_pic"));
      }
  }
  </code></pre>
  
  <p>The above code works fine. I am getting image in my local storage. But, I want to pass one more string intent with it.</p>
  
  <p>Something like,</p>
  
  <pre><code>cameraIntent.putExtra("profile_pic", "true");
  </code></pre>
  
  <p>And on response side I want to get that intent. But, I am getting <code>nullpointer exception</code>. What is the correct way to pass an intent ?</p>
  
  <p><strong>STACK TRACE</strong></p>
  
  <pre><code>01-09 13:29:36.228  23214-23214/com.example.android.navigationdrawerexample E/AndroidRuntime﹕ FATAL EXCEPTION: main
  Process: com.example.android.navigationdrawerexample, PID: 23214
  java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=null} to activity {com.example.android.navigationdrawerexample/com.example.android.mtesapp.EditProfileActivity}: java.lang.NullPointerException
          at android.app.ActivityThread.deliverResults(ActivityThread.java:3942)
          at android.app.ActivityThread.handleSendResult(ActivityThread.java:3992)
          at android.app.ActivityThread.access$1300(ActivityThread.java:156)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1403)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:157)
          at android.app.ActivityThread.main(ActivityThread.java:5872)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674)
          at dalvik.system.NativeStart.main(Native Method)
          Caused by: java.lang.NullPointerException
          at     com.example.android.mtesapp.EditProfileActivity.onActivityResult(EditProfileActivity.java:316)
          at android.app.Activity.dispatchActivityResult(Activity.java:5535)
          at android.app.ActivityThread.deliverResults(ActivityThread.java:3938)
          at android.app.ActivityThread.handleSendResult(ActivityThread.java:3992)
          at android.app.ActivityThread.access$1300(ActivityThread.java:156)
          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1403)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loop(Looper.java:157)
          at android.app.ActivityThread.main(ActivityThread.java:5872)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>