title: Camera intent throws Null Pointer Exception in Sony Phones
body: <p>I'm intenting <code>Camera Intent</code> which works perfectly on other devices except <code>Sony C2305</code> [4.2.2]. Tested on 4.2.2 Emulator which works perfectly fine.</p>
  
  <p>Following is the snippet . I uses to  call <code>Camera Intent</code></p>
  
  <pre><code> Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
   getImagePath();
   intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
   startActivityForResult(intent, REQUEST_CAMERA);
  </code></pre>
  
  <hr>
  
  <pre><code> public void getImagePath()
          {
              File imageDirectory =null;
              String state = Environment.getExternalStorageState();
              if (Environment.MEDIA_MOUNTED.equals(state)) 
              {
                  imageDirectory = new File(Environment.getExternalStorageDirectory().getPath()+"/ABC");
              }
              else
              {
                  imageDirectory = new File(SmartConsultant.getApplication().getApplicationContext().getFilesDir().getAbsolutePath());
              }
              imageDirectory.mkdirs();
              File tempFile = new File(imageDirectory, getVideoName()+ AppConstants.EXTENSION); //AppConstants.Extension is .jpg and getVideoName to fetch name of file as per current sys time.
              outputFileUri = Uri.fromFile( tempFile );
              currentFileUri = outputFileUri;
          }
  </code></pre>
  
  <p>Getting result of Activity as:</p>
  
  <pre><code>    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
     if (requestCode == REQUEST_CAMERA) {
              if(resultCode == RESULT_OK)
              {
                  BitmapFactory.Options btmapOptions = new BitmapFactory.Options();
                  btmapOptions.inSampleSize = 2;
                  bm = BitmapFactory.decodeFile(currentFileUri.getPath(), btmapOptions);
                  NewExpensesActivity.this.data.add(bm);
                  imagesAdapter.notifyDataSetChanged();
                      compressedPath = ImageCompression.compressImage(currentFileUri.getPath());//ADDED 10018
                      galleryAddPic();
                      paths.add(compressedPath);//EDITED 10018
  
              }
          }
            }
  </code></pre>
  
  <p>But it throws Null Pointer Exception on delivering result
  Log Cat:</p>
  
  <pre><code> java.lang.RuntimeException: Unable to resume activity {com.smarthumanoid.com/com.netdoers.com.ui.AddSxActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1001, result=-1, data=Intent { act=inline-data dat=file:///storage/sdcard0/SmartConsultant/20140217194718.jpg typ=image/jpeg (has extras) }} to activity {com.smarthumanoid.com/com.netdoers.com.ui.AddSxActivity}: java.lang.NullPointerException
  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2899)
  at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2928)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
  at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3865)
  at android.app.ActivityThread.access$700(ActivityThread.java:156)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1346)
  at android.os.Handler.dispatchMessage(Handler.java:99)
  at android.os.Looper.loop(Looper.java:153)
  at android.app.ActivityThread.main(ActivityThread.java:5299)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:511)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
  at dalvik.system.NativeStart.main(Native Method)
   Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1001, result=-1, data=Intent { act=inline-data dat=file:///storage/sdcard0/SmartConsultant/20140217194718.jpg typ=image/jpeg (has extras) }} to activity {com.smarthumanoid.com/com.netdoers.com.ui.AddSxActivity}: java.lang.NullPointerException
  at android.app.ActivityThread.deliverResults(ActivityThread.java:3488)
  at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2883)
  ... 13 more
   Caused by: java.lang.NullPointerException
  at com.netdoers.com.ui.AddSxActivity.onActivityResult(AddSxActivity.java:485)
  at android.app.Activity.dispatchActivityResult(Activity.java:5371)
  at android.app.ActivityThread.deliverResults(ActivityThread.java:3484)
  ... 14 more
  </code></pre>