1

In my website there are some downloadable contents. I have created a webview application out of that website using android studio. In my application when i click those downloadable contents nothing happens, it doesn't get downloaded. but if I use that website from moblile's browser it gets downloaded. Then What is the problem with my android application ?

hariGS
  • 60
  • 1
  • 2
  • 14

2 Answers2

1

Have you tried this

mWebView.setDownloadListener(new DownloadListener() {
public void onDownloadStart(String url, String userAgent,
            String contentDisposition, String mimetype,
            long contentLength) {
    Intent i = new Intent(Intent.ACTION_VIEW);
    i.setData(Uri.parse(url));
    startActivity(i);
}
});
0

Please Add this code to enable javascript in your webview. Because some javascript is not load in webview.

webView.getSettings().setDomStorageEnabled(true);

For more details follow below link

Enable Javascript in webview

Hope this will be help you

Shivam Kumar
  • 1,892
  • 2
  • 21
  • 33