title: ACTION_IMAGE_CAPTURE with EXTRA_OUTPUT creates handled "Handling Media Storage Error"
body: <p>I'm calling my camera via <code>startActivityForResult</code> with <code>android.provider.MediaStore.ACTION_IMAGE_CAPTURE</code> and <code>android.provider.MediaStore.EXTRA_OUTPUT</code> want to get the fullsize captured image back in my <code>onActivityResult</code></p>
  
  <p>But the moment I click on the checkmark after taking the picture, the moment when it should be delivered back, I get an error message which loosely translates to "Camera error - There has been a problem while saving one of your images or clips" - I can close the dialog or send feedback to the Google Dev team.</p>
  
  <p>Logcat output at this moment is:</p>
  
  <pre><code>09-01 22:01:46.157  24523-24523/com.google.android.GoogleCamera E/CAM_FatalErrorHandler﹕ Handling Media Storage Failure:
  java.lang.Exception
          at com.android.camera.FatalErrorHandlerImpl.onMediaStorageFailure(FatalErrorHandlerImpl.java:37)
          at com.android.camera.PhotoModule.onError(PhotoModule.java:274)
          at com.android.camera.PhotoModule.onCaptureDone(PhotoModule.java:1289)
          at com.android.camera.PhotoModule$8.onClick(PhotoModule.java:593)
          at android.view.View.performClick(View.java:4781)
          at android.view.View$PerformClick.run(View.java:19873)
          at android.os.Handler.handleCallback(Handler.java:739)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:135)
          at android.app.ActivityThread.main(ActivityThread.java:5289)
          at java.lang.reflect.Method.invoke(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:372)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
          at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:115)
  09-01 22:01:46.158  24523-24523/com.google.android.GoogleCamera E/CAM_CameraUtil﹕ Show fatal error dialog
  </code></pre>
  
  <p>My code (cleaned of irrelevant parts):</p>
  
  <pre><code>private File tmpFile;
  private Uri tmpFileURI;
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
  {
  
      //  TempFile needs to be created for the camera to store the fullsize captured image
      //  tmpFile = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + MainActivity.APP_BASE_FOLDER + "/tmp.jpg");
      try
      {
          tmpFile = File.createTempFile("my_app", ".jpg");
      } catch (IOException e)
      {
          e.printStackTrace();
      }
      tmpFileURI = Uri.fromFile(tmpFile);
  
      chooseCamera.setOnClickListener(new View.OnClickListener()
      {
          @Override
          public void onClick(View view)
          {
  
              takePicture = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
              takePicture.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, tmpFileURI);
              startActivityForResult(takePicture, CreateModifiyEventFragment.CHOOSE_BY_CAMERA);//zero can be replaced with any action code
  
          }
      });
  
  
      chooseLibrary.setOnClickListener(new View.OnClickListener()
      {
          @Override
          public void onClick(View view)
          {
  
              pickPhoto = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
              startActivityForResult(pickPhoto, CreateModifiyEventFragment.CHOOSE_BY_LIBRARY);//one can be replaced with any action code
  
          }
      });
  
  }
  </code></pre>
  
  <p>The seen constants are declared like this:</p>
  
  <pre><code>public final static int CHOOSE_BY_CAMERA = 1;
  public final static int CHOOSE_BY_LIBRARY = 0;
  </code></pre>
  
  <p>The callback code is never reached, so I'm just going to spare you more code.
  You can see I tried it via tmpFile and a normal File on external storage.</p>
  
  <p>Permissions are set also</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  </code></pre>
  
  <p>I have no idea what triggers this error or what I am missing out. I used other SO answers to create this code, and I don't see any differences.</p>
  
  <p>Any help would be greatly appreciated. Thanks in advance SO!</p>