title: Camera Intent result woes
body: <p>I am attempting to launch the built-in camera to take a picture, a picture that will have a name specified by the activity launching the camera.  (code below)</p>
  
  <ol>
  <li><p>When the camera returns, <code>onActivityResult()</code> goes straight to <code>resultCode == Activity.RESULT_CANCELED</code>.  Any explanation for this and solutions would be greatly appreciated.  </p></li>
  <li><p>The camera indeed does take the image, I can see it in my sdcard with a file viewer, but its name is the stock one from the camera.  How can I get the name of this taken image to be the one supplied by the activity?</p></li>
  </ol>
  
  <p>Camera intent code</p>
  
  <pre><code>Intent camera = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  File image = new File("Team image.jpg");
  camera.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
  camera.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(image));
  camera.putExtra(MediaStore.Images.Media.TITLE, "Team image");
          startActivityForResult(camera, PICTURE_RESULT);
  </code></pre>
  
  <p>activityresult code</p>
  
  <pre><code>@Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data){
  
      if(requestCode == PICTURE_RESULT){
          if(resultCode == Activity.RESULT_OK) {
              if(data!=null){
                  Bitmap image = BitmapFactory.decodeFile(data.getExtras().get(MediaStore.Images.Media.TITLE).toString());
                  grid.add(image);            
                  images.addItem(image);
              }
              if(data==null){
                  Toast.makeText(Team_Viewer.this, "no data.", Toast.LENGTH_SHORT).show();
              }
          }
          else if(resultCode == Activity.RESULT_CANCELED) {
              Toast.makeText(Team_Viewer.this, "Picture could not be taken.", Toast.LENGTH_SHORT).show();
          }
  }
  }
  </code></pre>