Home > Backend Development > PHP Tutorial > android webview 嵌入网页

android webview 嵌入网页

WBOY
Release: 2016-06-06 20:29:28
Original
1576 people have browsed it

android 使用webview 嵌入网页

<code>网页里面a标签进行apk下载
结果发现点击手机屏幕无响应
用浏览器访问是可以正常触发下载的
</code>
Copy after login
Copy after login

请问哪位大侠有遇到过类似情况的
求解~~~

回复内容:

android 使用webview 嵌入网页

<code>网页里面a标签进行apk下载
结果发现点击手机屏幕无响应
用浏览器访问是可以正常触发下载的
</code>
Copy after login
Copy after login

请问哪位大侠有遇到过类似情况的
求解~~~

webview 的下载要自己实现,webView.setDownloadListener 通过这个得到下载事件,处理下载逻辑

如果只有一个链接可以这么做:

<code>webView.setWebViewClient(new WebViewClient() {
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                download(url);
                return true;
            }
        });</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template