title: Download Images and mp3 with webview Android
body: <p>I need to Download images(png,jpg,jpeg,gif) and mp3 in Android webView.
  When i click download mp3 button or image button it not give any response.
  Below is my code</p>
  
  <pre><code>@Override
          public boolean shouldOverrideUrlLoading(WebView view, String url) {
              progressBar.setVisibility(View.VISIBLE);
              if(webview.getUrl().contains(".mp3")){
                  DownloadManager.Request request = new DownloadManager.Request(
                          Uri.parse(url));
                  request.allowScanningByMediaScanner();
                  request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
                  request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "download mp3");
  
                  DownloadManager dm = (DownloadManager) getSystemService(DOWNLOAD_SERVICE);
                  dm.enqueue(request);
  
              }
              if(url.indexOf("somesite.com") &gt; -1 ) return false;
  
              Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
              startActivity(intent);
              return true;
          }
  </code></pre>
  
  <p>Im using api levels from 21.</p>
  
  <p>i also have storage read write permission in manifest.
  Kindly Help</p>