title: Unable to save pdf file from link in Android
body: <p>I want to download a PDF file from link. I am trying this code.</p>
  
  <pre><code>DownloadManager.Request request = new DownloadManager.Request(uri);
  request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
  request.setMimeType("application/pdf");
  request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "filename.pdf");
  long reference = downloadManager.enqueue(request);
  </code></pre>
  
  <p>Also using permission as follows,</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  </code></pre>
  
  <p>But, it giving me "Download Unsuccessful" error</p>