title: Failure delivering result ResultInfo android
body: <p>My app is when user click take a photo button,it will save a picture in external storage.in this face it's working when i check in my folder in device.But I don't understand why My intent equal null ,while i putExtra into intent.And </p>
  
  <p>this is my code</p>
  
  <pre><code>private void captureImage(){
      //check Is device support a camera??
      isDeviceSupportCamera();
      if(isDeviceSupportCamera() == true){
          //intent to camera process
          Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
          //สร้างไฟล์ใหม่มาลองรับ รูปที่ถูกถ่าย ไปยัง picDirectory
          imageFile = new File(Environment.getExternalStorageDirectory()+path,
                      "img_"+System.currentTimeMillis()+".jpg");
  
          startActivityForResult(intent, imageCode);
      }else{
          System.out.println("Your device is not supprot feature camera");
      }
  
  }
  
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
  
      if(requestCode == imageCode &amp;&amp; resultCode == RESULT_OK){
  
  
  
              //add imageFile to array File
              fileCapture.add(imageFile);
              //set adapter
              gridView.setAdapter(new gridviewAdapter(context, fileCapture));
  
  
      }else if(requestCode == imageCode &amp;&amp; resultCode == RESULT_CANCELED){
          Toast.makeText(getApplicationContext(), "user cancle a image capture", Toast.LENGTH_LONG).show();
      }else{
          Toast.makeText(getApplicationContext(), "Failed to capture", Toast.LENGTH_LONG).show();
      }
  
  }
  </code></pre>
  
  <p>and this is logcat error</p>
  
  <pre><code>02-07 00:48:05.666: E/AndroidRuntime(18495): FATAL EXCEPTION: main
  02-07 09:37:34.625: E/AndroidRuntime(24772): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=100, result=-1, data=Intent { act=inline-data dat=content://media/external/images/media/14298 (has extras) }} to activity {com.example.newlookrecipe/com.example.newlookrecipe.MainActivity}: java.lang.NullPointerException{com.example.newlookrecipe/com.example.newlookrecipe.MainActivity}: java.lang.NullPointerException
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at android.app.ActivityThread.deliverResults(ActivityThread.java:3205)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3248)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at android.app.ActivityThread.access$1200(ActivityThread.java:140)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1285)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at android.os.Handler.dispatchMessage(Handler.java:99)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at android.os.Looper.loop(Looper.java:137)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at android.app.ActivityThread.main(ActivityThread.java:4921)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at java.lang.reflect.Method.invokeNative(Native Method)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at java.lang.reflect.Method.invoke(Method.java:511)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at dalvik.system.NativeStart.main(Native Method)
  02-07 00:48:05.666: E/AndroidRuntime(18495): Caused by: java.lang.NullPointerException
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at com.example.newlookrecipe.MainActivity.onActivityResult(MainActivity.java:96)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at android.app.Activity.dispatchActivityResult(Activity.java:5390)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    at android.app.ActivityThread.deliverResults(ActivityThread.java:3201)
  02-07 00:48:05.666: E/AndroidRuntime(18495):    ... 11 more
  </code></pre>