title: Get Path and Filename from Camera intent result
body: <p>I want to make a picture with the camera intent and save it to the default DCIM folder. Then I want to get the path/filename where the picture is stored.</p>
  
  <p>I am trying it with the following code:</p>
  
  <pre><code>Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  startActivityForResult(intent, TAKE_PICTURE);
  </code></pre>
  
  <p>With this code, the camera opens and after I have taken one picture it closes and saves the picture to the default image folder (usually /dcim/camera or sdcard/dcim/camera...)</p>
  
  <p>but how can I get the path and filename of the taken picture now?
  I have tried almost everything in <code>onActivityResult</code>
  I tried</p>
  
  <pre><code>String result = data.getData();
  </code></pre>
  
  <p>and</p>
  
  <pre><code>String result = data.getDataString();
  </code></pre>
  
  <p>and</p>
  
  <pre><code>String result = data.toURI();
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Uri uri = data.getData();
  </code></pre>
  
  <p>etc.</p>
  
  <p>I researched the last two days to find a solution for this, there are many articles on the web and on stackoverflow but nothing works.
  I don't want a thumbnail, I only want the path (uri?) to the image that the camera has taken.</p>
  
  <p>Thank you for any help</p>
  
  <p>EDIT:
  When I try:</p>
  
  <pre><code>path=Environment.DIRECTORY_DCIM + "/test.jpg";
  File file = new File(path);
  Uri outputFileUri = Uri.fromFile(file);
  Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
  startActivityForResult(intent, TAKE_PICTURE); 
  </code></pre>
  
  <p>it does not store the image as test.jpg but with the normal image name 2011-10-03.....jpg (but that is ok too, i only need the path to the image, it does not matter what the name is).</p>
  
  <p>Best regards</p>
  
  <p><strong>EDIT Again</strong></p>
  
  <pre><code>path=Environment.getExternalStorageDirectory().getPath() + "/DCIM/Camera/";
  File file = new File(path,"test111111111.jpg");
  try {
  file.createNewFile();
  } catch (IOException e) {
  e.printStackTrace();
  }
  Uri outputFileUri = Uri.fromFile(file);
  Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
  
  startActivityForResult(intent, TAKE_PICTURE); 
  </code></pre>
  
  <p>When I try this, it stores the image to the right folder and with the given name (e.g. test111111.jpg).
  But how can I get the filepath now in onActivityResult?</p>