android webView用法
2011-08-31 17:15
183 查看
先讲述一下
webView.loadDataWithBaseURL(url, doc, mimeType, charset, url);
函数原型
void android.webkit.WebView.loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl)Parameters:
baseUrl Url to resolve relative paths with, if null defaults to "about:blank"data A String of data in the given encoding. mimeType The MIMEType of the data. i.e. text/html. If null, defaults to "text/html"encoding The encoding of the data. i.e. utf-8, us-ascii historyUrl URL to use as the history entry. Can be null.
说一下方法遇到的几个问题
1: 如果不写 baseUrl 指定data内的 超链接如果写的是 /开头的uri 的话, 将会无法访问
2:baseUrl 如果写成主机的domain 例如 http://www.google.cn 可以访问 data中的超链接,但是 无法使用 goback
3: 将 baseUrl 与 historyUrl 写成相同的,一切正常
webView.loadDataWithBaseURL(url, doc, mimeType, charset, url);
函数原型
void android.webkit.WebView.loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl)Parameters:
baseUrl Url to resolve relative paths with, if null defaults to "about:blank"data A String of data in the given encoding. mimeType The MIMEType of the data. i.e. text/html. If null, defaults to "text/html"encoding The encoding of the data. i.e. utf-8, us-ascii historyUrl URL to use as the history entry. Can be null.
说一下方法遇到的几个问题
1: 如果不写 baseUrl 指定data内的 超链接如果写的是 /开头的uri 的话, 将会无法访问
2:baseUrl 如果写成主机的domain 例如 http://www.google.cn 可以访问 data中的超链接,但是 无法使用 goback
3: 将 baseUrl 与 historyUrl 写成相同的,一切正常
相关文章推荐
- 【Android基础知识】WebView基本用法
- Android之网络编程(一)WebView 的用法
- Android WebView的用法
- android webview用法小结1
- Android WebView组件用法详解
- Android WebView属性及用法
- Android中WebView的一些简单用法
- android webview用法小结1
- Android WebView用法和WebView加载提升网页速度
- android webview用法小结2 java与javascript的交互
- Android中的WebView控件用法(二)
- Android基础学习总结(十)——WebView的基本用法总结
- [Android_Webview]WebView的基本用法
- android webview用法小结2 java与javascript的交互
- Android_WebView用法
- Android---WebView基本用法
- android网络技术-WebView的用法
- android WebView, WebChromeClient跟WebViewClient加载网页基本用法
- android webview用法小结
- Android中js交互以及webview的一些用法