title: Android crashing after camera Intent
body: <p>I have an app published and one of the fundamental features is to allow the user to take a picture, and then save that photo in a specific folder on their External Storage. </p>
  
  <p>Everything seems to be working fine, but I've gotten two reports now that claim that after taking a photo, and clicking "Done" to exit the camera (and return back to the Activity), the app is Forced Closed, bringing the user back to the home screen. </p>
  
  <p>This happens on a Samsung Nexus S and the Galaxy Tab. Below I've posted my code to show I set up my intent and how I handle saving and displaying the photo in onActivityResult(). Any guidance on what might be causing it to crash after they click "Done" to exit the camera app, would be greatly appreciated! </p>
  
  <p>Again, this seems to be working fine on most devices but I was wondering if their is a more efficient, universal approach I should be taking. Thank you</p>
  
  <p>How I'm firing the Camera Intent</p>
  
  <pre><code>   case ACTION_BAR_CAMERA:
  
          // numbered image name
          fileName = "image_" + String.valueOf(numImages) + ".jpg";
  
  
          output = new File(direct + File.separator + fileName); // create
                                                                      // output
          while (output.exists()) { // while the file exists
              numImages++; // increment number of images
              fileName = "image_" + String.valueOf(numImages) + ".jpg";
              output = new File(outputFolder, fileName);
  
  
          }
          camera = new   Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
          uriSavedImage = Uri.fromFile(output); // get Uri of the output
          camera.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage); //pass in Uri to camera intent
          startActivityForResult(camera, 1);
  
  
          break;
      default:
          return super.onHandleActionBarItemClick(item, position);
      }
      return true;
  }
  </code></pre>
  
  <p>How I'm setting up onActivityResult()</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      // TODO Auto-generated method stub
      super.onActivityResult(requestCode, resultCode, data);
  
      if (resultCode == RESULT_OK) { // If data was passed successfully
  
          Bundle extras = data.getExtras();
  
          //Bundle extras = data.getBundleExtra(MediaStore.EXTRA_OUTPUT);
  
          /*ad = new AlertDialog.Builder(this).create();
          ad.setIcon(android.R.drawable.ic_menu_camera);
          ad.setTitle("Save Image");
          ad.setMessage("Save This Image To Album?");
          ad.setButton("Ok", this);
  
          ad.show();*/
  
  
  
          bmp = (Bitmap) extras.get("data"); // Set the bitmap to the bundle
                                              // of data that was just
                                              // received
          image.setImageBitmap(bmp); // Set imageview to image that was
                                      // captured
          image.setScaleType(ScaleType.FIT_XY);
  
  
      }
  
  }
  </code></pre>