3
我有一个带有下载监听器的WebView。当我点击链接时,例如: http://fzs.sve-mo.ba/sites/default/files/dokumenti-vijesti/sample.pdf Android Download Manager启动。 问题是当我点击Android 5.0或更高版本时,onDownloadStart从未调用过。我不知道发生了什么,我该如何解决它?谢谢。Webview onDownloadStart从未在Android 5或更高版本上调用过
webView.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);
}
});