Android使用WebView展示本地html网页

04-02 1898阅读 0评论

Android使用WebView展示本地html网页

1、在assets目录下新建html文件

新建agreement.html文件,内容如下:

Android使用WebView展示本地html网页,Android使用WebView展示本地html网页,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,博客,本地,第1张
(图片来源网络,侵删)

    用户协议


用户协议

2、新建WebView对象,使用loadUrl打开html

代码如下:

WebView webView = (WebView) findViewById(R.id.web_view);
webView.loadUrl("file:///android_asset/agreement.html");

接着就可以展示刚才的html文件了

参考博客:android html跳转页面代码

Android使用WebView展示本地html网页,Android使用WebView展示本地html网页,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,博客,本地,第2张
(图片来源网络,侵删)
Android使用WebView展示本地html网页,Android使用WebView展示本地html网页,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,博客,本地,第3张
(图片来源网络,侵删)

免责声明
本网站所收集的部分公开资料来源于AI生成和互联网,转载的目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

发表评论

快捷回复: 表情:
评论列表 (暂无评论,1898人围观)

还没有评论,来说两句吧...

目录[+]