Download File inside WebView
Posted
by
Mayu Mayooresan
on Stack Overflow
See other posts from Stack Overflow
or by Mayu Mayooresan
Published on 2012-04-09T04:56:08Z
Indexed on
2012/04/09
5:29 UTC
Read the original article
Hit count: 244
I have a webview in my Android Application. When user goes to webview and click a link to download a file nothing happens.
URL = "my url";
mWebView = (WebView) findViewById(R.id.webview);
mWebView.setWebViewClient(new HelloWebViewClient());
mWebView.getSettings().setDefaultZoom(ZoomDensity.FAR);
mWebView.loadUrl(URL);
Log.v("TheURL", URL);
How to enable download inside a webview?? If I disable webview and enable the intent to load the url on broswer from application then download works seamlessly.
String url = "my url";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
Can someone help me out here. The page loads without issue but the link to a image file in the html page is not working.... Thanks in advance for your time.
© Stack Overflow or respective owner