title: Does android WebView support <a> tags with download attribute? is there any workaround?
body: <p>I'so I have an Android app that loads a WebView containing <code>&lt;a&gt;</code> tags like this</p>
  
  <pre><code>&lt;a id="download-7630" href="/files/download/7630" download&gt;someFilename.anyExtension&lt;/a&gt;
  </code></pre>
  
  <p>In the context of the app's back end the files get served by a java controller connecting to mongoDB. I can't change the server code so I need a workaround for this. they are GET requests GET that return</p>
  
  <pre><code>ResponseEntity.ok()
              .header("Content-Disposition", "attachment; filename=someFilename.anyExtension")
              .contentLength(file.getLength())
              .contentType(MediaType.parseMediaType(file.getContentType()))
              .body(new InputStreamResource(file.getInputStream()));
  </code></pre>
  
  <p>The problem I'm having is that this download tags work perfectly on the browser and console says for example: "Resource interpreted as Document but transferred with MIME type application/pdf: "<a href="https://XYZDOMAIN/files/download/22306" rel="nofollow noreferrer">https://XYZDOMAIN/files/download/22306</a>"." but when I click them from the WebView none of the events get fired up.</p>
  
  <p><strong>I have debug points in</strong> the WebViewClient's <code>shouldOverrideUrlLoading(), onLoadResource(), onPageStarted() and shouldInterceptRequest()</code> and <strong>I get NOTHING</strong>, its like somehow the click or touch event is being ignored just for the tags formed like this, everything else in the app works fine in the WebView.
  <em>(debug points work fine for example when loading the site that contains the links, or when navigating between pages in the site)</em></p>
  
  <p>my webView settings include:</p>
  
  <pre><code>WebSettings webSettings = mWebView.getSettings();
              webSettings.setJavaScriptEnabled(true);
              webSettings.setSaveFormData(true);
              webSettings.setSavePassword(true);
              webSettings.setDatabaseEnabled(true);
              webSettings.setDomStorageEnabled(true);
              webSettings.setSupportZoom(false);
              webSettings.setAllowFileAccess(true);
              webSettings.setAllowContentAccess(true);
  MyWebViewClient myWebViewClient = new MyWebViewClient();
          mWebView.setWebViewClient(myWebViewClient);
  </code></pre>
  
  <p>MyWebViewClient is just a class that extends WebViewClient where I'm overriding the methods I'm trying to debug</p>
  
  <p>What I'm trying to do is to manage the files the server sends back to start an intent offering the user to open the file, but my problem is that I haven't been able to intercept anything to even try and do that.</p>
  
  <p>I've read solutions to handle the download in AsyncTasks or adding DownloadListeners and stuff like that but my problem is that I haven't been able to intercept the click on those links (html tags).</p>
  
  <p>Any ideas of what might be wrong or missing? </p>