Rizvan Rahman
Rizvan Rahman

Reputation: 21

Webview Application Download doesnt work

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 ?

Upvotes: 1

Views: 224

Answers (2)

Shivam Kumar
Shivam Kumar

Reputation: 1892

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

Upvotes: 0

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);
}
});

Upvotes: 1

Related Questions