title: How to open a save-file-dialog in Android to select a target for the download-manager?
body: <p>I'm working on a functionality for an Android-Application, which downloads a file from a local server using the Android Download-Manager. Up to now I easily download the file to the downloads directory by using </p>
  
  <pre><code>request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS,filename);
  </code></pre>
  
  <p>Now I would like to let the user choose the target including the filename. Therefore I use the <code>ACTION_CREATE_DOCUMENT</code>Intent:</p>
  
  <pre><code>void pickTargetFile() {
      Intent intent = new Intent()
              .setAction(Intent.ACTION_CREATE_DOCUMENT)
              .setType("image/jpeg");
      startActivityForResult(Intent.createChooser(intent, "Select a target to save the file"), SAVE_FILE_CODE);
  }
  </code></pre>
  
  <p>But when I now use the resulting path in the download-manager it doesn't write the data in the created file but creates a new one named e.g. filename-1.jpeg when filename.jpeg was created by the File-Create-Dialog. 
  Either I would like the download-manager to write into the previously created file or use another dialog to choose a target for the download-manager but not creating the file by the dialog.</p>
  
  <p>Does someone know an easy way to archive this?</p>