title: Unable to download the pdf file from WebView. Always download .bin file. I checked in one plus mobile having android 10
body: <p>I try to download file inside a WebView. File is downloaded using browser but when I try to download through mobile WebView. It is download as .bin file. I checked this in android 10 device. It is working in below android 10. I was using Advance WebView library to open the WebView.  I am using below code for that. Any help will be highly appreciated.</p>
  <pre><code>@Override
  public void onDownloadRequested(String url, String suggestedFilename, String mimeType, long contentLength, String contentDisposition, String userAgent) {
  
  
      DownloadManager.Request request = new DownloadManager.Request(
              Uri.parse(url));
  
      request.setMimeType(mimeType);
      String cookies = CookieManager.getInstance().getCookie(url);
      request.addRequestHeader(&quot;cookie&quot;, cookies);
      request.addRequestHeader(&quot;User-Agent&quot;, userAgent);
      request.setDescription(&quot;Downloading file...&quot;);
  
      request.setTitle(URLUtil.guessFileName(url, contentDisposition,
              mimeType));
      request.allowScanningByMediaScanner();
      request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
      request.setDestinationInExternalPublicDir(
              Environment.DIRECTORY_DOWNLOADS, URLUtil.guessFileName(
                      url, contentDisposition, mimeType));
      DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
      dm.enqueue(request);
      Toast.makeText(getApplicationContext(), &quot;Downloading File&quot;,
              Toast.LENGTH_LONG).show();
      Log.d(&quot;dsfgh&quot;, &quot;onDownloadRequested: &quot;+url);
  
  }
  </code></pre>