title: Android downloading file through DownloadManager not working correctly
body: <p>I'm trying to download files thru DownloadManager, it works perfectly on most of the phones (Nexus family, S3, etc) but on Galaxy S2 for some reason the download works, but the name of the file is set wrong and when I try to open it (either from notification, either downloads app) it says that the file cannot be opened, even for files like jpeg, gif, png, etc.</p>
  
  <p><img src="https://i.stack.imgur.com/RWCBJ.png" alt="enter image description here"></p>
  
  <p>Here is the code:</p>
  
  <pre><code>DownloadManager downloadManager = (DownloadManager) service
                  .getSystemService(Context.DOWNLOAD_SERVICE);
          DownloadManager.Request downloadReq = new DownloadManager.Request(
                  Uri.parse(URL));
          downloadReq
                  .setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI
                          | DownloadManager.Request.NETWORK_MOBILE);
          downloadReq.allowScanningByMediaScanner();
          downloadReq.setMimeType(attachment.mimeType);
          downloadReq.setTitle(attachment.fileName);
          downloadReq.setDescription("attachment");
          downloadReq.setDestinationInExternalFilesDir(service,
                  Environment.DIRECTORY_DOWNLOADS, "");
          downloadReq
                  .setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE
                          | DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
  
          downloadIDs.add(downloadManager.enqueue(downloadReq));
  </code></pre>
  
  <p>Also please note that all the URLs are https, and the phone's android version is 4.1.2
  Any idea?</p>
  
  <p>Many Thanks!</p>
  
  <p>Update: if I add the file name in this call: </p>
  
  <pre><code>downloadReq.setDestinationInExternalFilesDir(service,
                  Environment.DIRECTORY_DOWNLOADS, attachment.fileName);
  </code></pre>
  
  <p>the good name is displayed in the notification center.</p>