[英]Download mp4 in Android WebView
I have a WebView
which goes to a website which has mp4
files available for download, but when i press the download button nothing happens. 我有一个WebView
可以转到一个网站,该网站上有可供下载的mp4
文件,但是当我按下下载按钮时,没有任何反应。 Is there any way to be able to download the file through the WebView
? 有什么方法可以通过WebView
下载文件吗?
Help would be appreciated. 帮助将不胜感激。
there is method of WebView let you Do It : WebView有一种方法可以让您做到:
wv.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
downloadMethod(url);
return true; // false : allow redirect , true : intercept redirect
}
});
take Care to return Boolean . 注意返回 Boolean。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.