- 浏览: 663197 次
- 性别:
- 来自: 安徽
文章分类
- 全部博客 (252)
- Html/Div+CSS (12)
- Js/Jquery (34)
- Flex (2)
- Ajax (3)
- Java (35)
- C# (15)
- Spring (16)
- Hibernate (13)
- Struts2 (12)
- Struts1 (7)
- DWR (1)
- iBatis/myBatis (9)
- Tag(JSTL、EL) (1)
- Android (44)
- SQL (7)
- SEO (7)
- Exception (3)
- Tool (10)
- Other (3)
- WebService (9)
- Apache (7)
- Ext (0)
- Utils (12)
- thinking in programme (2)
- Hadoop (0)
- ActiveMQ (0)
- HTML5/CSS3 (0)
- WPF (1)
- NodeJs (1)
- 设计模式 (0)
- 程序人生 (1)
- 随笔 (1)
- Linux (1)
- Load Balance (0)
最新评论
-
drinkjava2:
太复杂了而且不通用,利用ThreadLocal可完美解决这一问 ...
JDBC的多条件动态查询 -
u013107014:
multipartRequest.getFiles(" ...
多文件上传 by MultipartFile and Multiple -
liyys:
可惜没讲你mysql数据库的表的设计
iBatis入门 -
Mapple_leave:
效果还是挺不错的,谢谢了。
中文简体与繁体的转换 -
arcpad:
JS禁用浏览器退格键
WebView 是一个开发的浏览器组件,是基于 WebKit 内核开发出来的,如 Safari 、 Google Chrome 浏览器都是通过 WebView 实现的,而在 Android 系统中,默认提供了 WebView 组件的支持。除了支持各个浏览器的“前进”、“后退”等功能之外,最为强大的是在 WebView 组件之中也支持 JavaScript 的操作。
一、加载网页
要想使用 WebView 加载网页,最简单的方法就是使用 loadUrl() 方法,此方法只需要输入网页的 URL 地址即可。下面涉及网络访问的需要加载网络访问权限,这里不一一说了。
main.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <Button android:id="@+id/open" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="打开" /> <EditText android:id="@+id/inputurl" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="http://www.baidu.com" /> </LinearLayout> <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout>
WebView01_Activity.java
package com.iflytek.demo; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.webkit.WebView; import android.widget.Button; import android.widget.EditText; public class WebView01_Activity extends Activity { private Button openBtn = null; private EditText inputurl = null; private WebView webview = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.openBtn = (Button) super.findViewById(R.id.open); this.inputurl = (EditText) super.findViewById(R.id.inputurl); this.webview = (WebView) super.findViewById(R.id.webview); this.openBtn.setOnClickListener(new OpenOnClickListenerImpl()); } private class OpenOnClickListenerImpl implements OnClickListener { @Override public void onClick(View v) { String url = WebView01_Activity.this.inputurl.getText().toString(); WebView01_Activity.this.webview.loadUrl(url);// 加载页面 } } }
上面也可以将字符串中定义的HTML标记变为网页,在WebView中显示。
Main.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout>
WebView02_Activity.java
package com.iflytek.demo; import android.app.Activity; import android.os.Bundle; import android.webkit.WebView; public class WebView02_Activity extends Activity { private WebView webview = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.webview = (WebView) super.findViewById(R.id.webview); String data = "<h1>this.is baidu.</h1>" + "<h2><a href=\"http://www.baidu.com\">BAIDU</a><h2>"; this.webview.loadData(data, "text/html", "UTF-8"); } }
二、控制 WebView ,实现属于自己的浏览器
Main.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/open" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="打开" /> <Button android:id="@+id/back" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="后退" /> <Button android:id="@+id/forward" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="前进" /> <Button android:id="@+id/zoomout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="缩小" /> <Button android:id="@+id/zoomin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="放大" /> <Button android:id="@+id/clear" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="清空" /> </LinearLayout> <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout>
WebView02_Activity.java
package com.iflytek.demo; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.webkit.WebView; import android.widget.Button; public class WebView02_Activity extends Activity { private Button openBtn = null; private Button backBtn = null; private Button forwardBtn = null; private Button zoominBtn = null; private Button zoomoutBtn = null; private Button clearBtn = null; private WebView webview = null; private String urlData[] = new String[] { "http://www.baidu.com", "http://www.iteye.com", "http://www.eoeandroid.com/", "http://blog.jobbole.com/", "http://www.cnblogs.com/" }; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.webview = (WebView) super.findViewById(R.id.webview); this.openBtn = (Button) super.findViewById(R.id.open); this.backBtn = (Button) super.findViewById(R.id.back); this.forwardBtn = (Button) super.findViewById(R.id.forward); this.zoominBtn = (Button) super.findViewById(R.id.zoomin); this.zoomoutBtn = (Button) super.findViewById(R.id.zoomout); this.clearBtn = (Button) super.findViewById(R.id.clear); this.openBtn.setOnClickListener(new OpenOnClickListenerImpl()); this.backBtn.setOnClickListener(new BackOnClickListenerImpl()); this.forwardBtn.setOnClickListener(new ForwardOnClickListenerImpl()); this.zoominBtn.setOnClickListener(new ZoomInOnClickListenerImpl()); this.zoomoutBtn.setOnClickListener(new ZoomOutClickListenerImpl()); this.clearBtn.setOnClickListener(new ClearOnClickListenerImpl()); } private class OpenOnClickListenerImpl implements OnClickListener { @Override public void onClick(View v) { WebView02_Activity.this.showUrlDialog(); } } private class BackOnClickListenerImpl implements OnClickListener { @Override public void onClick(View v) { if (WebView02_Activity.this.webview.canGoBack()) { WebView02_Activity.this.webview.goBack(); } } } private class ForwardOnClickListenerImpl implements OnClickListener { @Override public void onClick(View v) { if (WebView02_Activity.this.webview.canGoForward()) { WebView02_Activity.this.webview.goForward(); } } } private class ZoomInOnClickListenerImpl implements OnClickListener { @Override public void onClick(View v) { WebView02_Activity.this.webview.zoomIn(); } } private class ZoomOutClickListenerImpl implements OnClickListener { @Override public void onClick(View v) { WebView02_Activity.this.webview.zoomOut(); } } private class ClearOnClickListenerImpl implements OnClickListener { @Override public void onClick(View v) { WebView02_Activity.this.webview.clearHistory(); } } private void showUrlDialog() { Dialog dialog = new AlertDialog.Builder(this).setIcon(R.drawable.ic_launcher) .setTitle("请选择要浏览的网站") .setNegativeButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }) .setItems(this.urlData, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { webview.loadUrl(urlData[which]); } }).create(); dialog.show(); } }
三、通过 HTML 定义显示界面
在前面我们使用 WebView 组件浏览的是 Web 站点,而实际上,也可以通过 WebView 组件加载项目中的 HTML 页面,以达到界面显示的操作,但是在进行这些操作之前,首先必须了解 android.webkit.WebSettings 类,此类的主要功能是进行 WebView 的操作设置,用户可以通过 WebView 类中的 getSettings() 方法取得 WebSettings 类的对象,该对象常用方法如下:
No. |
方法 |
描述 |
1 |
Public void setBuitInZoomControls(Boolean enabled) |
设置是否可以进行缩放控制 |
2 |
Public synchronized void setJavaScriptEnabled(Boolean falg) |
设置是否启动 JavaScript 支持 |
3 |
Public void setSaveFormData(Boolean save) |
设置是否保存表单数据 |
4 |
Public void setSavePassword(Boolean save) |
设置是否保存密码 |
5 |
Public synchronized void setGeolocationEnabled(Boolean flag) |
设置是否可以获取地理位置 |
要通过 HTML 设置显示界面,则还涉及 HTML 文件的保存问题,此时用户可以将文件保存在 Android 项目的 assets 文件夹下的 html 文件夹。
下面定义包含 JS 的 HTML 文件 assests/html/show_htmlinjs.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <script language="javascript"> function openurl(url) { window.location = url; } </script> </head> <body> <center> <img src="../images/java.jpg" width="150" height="220"> <h3>请选择您要浏览的网站:</h3> <select name="url" onchange="openurl(this.value)"> <option value="http://www.baidu.com">BaiDu</option> <option value="http://www.iteye.com">Iteye</option> <option value="http://www.google.com">Googlg</option> </select> </center> </body> </html>
WebView03_Activity.java
package com.iflytek.demo; import android.app.Activity; import android.os.Bundle; import android.webkit.WebView; public class WebView03_Activity extends Activity { private WebView webview = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.webview = (WebView) super.findViewById(R.id.webview); this.webview.getSettings().setJavaScriptEnabled(true); // 启用JavaScript this.webview.getSettings().setBuiltInZoomControls(true); // 控制页面缩放 this.webview.loadUrl("file:/android_asset/html/show_htmlinjs.html"); } }
四、本地程序与 JavaScript 互操作
使用 WebView 还可以专门处理 JavaScript 返回的警告框、确认框等互操作,此时就需要使用 android.webkit.WebChromeClient 客户端处理的操作类完成。其常用方法:
No. |
方法 |
描述 |
1 |
Public void onCloseWindow(WebView window) |
窗口关闭操作 |
2 |
Public Boolean onCreateWindow(WebView view,Boolean dialog,Boolean userGesture,Message resultMsg) |
创建新的 WebView |
3 |
Public Boolean onJsAlert(WebView view String url,String message,JsResult result) |
弹出警告框互操作 |
4 |
Public Boolean onJsBeforeUnload(WebView view,String url,String message,JsResult result) |
页面关闭互操作 |
5 |
Public Boolean onJsConfirm(WebView view,String url,String message,JsResult result) |
弹出确认框互操作 |
6 |
Public Boolean onJsPrompt(WebView view,String url,String message,String defaultValue,JsPromptResult result) |
弹出提示框互操作 |
7 |
Public Boolean onJsTimeout() |
计时器已到互操作 |
8 |
Public void onProgressChanged(WebView view,int newProgress) |
进度改变互操作 |
9 |
Public void onReceivedTitle(WebView view,String title) |
接收页面标题互操作 |
定义 HTML 界面 show_js.html
<head> <title>Iteye:www.iteye.com</title> <meta http-equiv="Content-Type" content="text/html;charset=GBK"> <script language="javascript"> function openAlert(){ window.alert("Iteye:\nwww.iteye.com") ; } function openConfirm(){ if (window.confirm("是否删除此信息?")) { window.location = "delete_js.html" ; } } </script> </head> <input type="button" value="弹出警告框" onclick="openAlert()"> <input type="button" value="弹出确认框" onclick="openConfirm()">
delete_js.html
<head> <title>Iteye:www.iteye.com</title> <meta http-equiv="Content-Type" content="text/html;charset=GBK"> </head> <h1>信息已删除!</h1>
WebView04_Activity.java
package com.iflytek.demo; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; import android.webkit.JsResult; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.widget.Toast; public class WebView04_Activity extends Activity { private WebView webview = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.webview = (WebView) super.findViewById(R.id.webview); this.webview.getSettings().setJavaScriptEnabled(true); // 启用JavaScript this.webview.getSettings().setBuiltInZoomControls(true); // 控制页面缩放 this.webview.setWebChromeClient(new WebChromeClientImpl());//接受客户端操作 this.webview.loadUrl("file:/android_asset/html/show_js.html");//读取网页 } private class WebChromeClientImpl extends WebChromeClient { @Override public boolean onJsAlert(WebView view, String url, String message, final JsResult result) { Dialog dialog = new AlertDialog.Builder(WebView04_Activity.this) .setIcon(R.drawable.ic_launcher) .setTitle("Xdwang警告") .setMessage(message) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Toast.makeText(WebView04_Activity.this, "关闭警告框", Toast.LENGTH_SHORT).show(); result.cancel(); } }).create(); dialog.show(); return true; } @Override public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) { Dialog dialog = new AlertDialog.Builder(WebView04_Activity.this) .setIcon(R.drawable.ic_launcher) .setTitle("确定删除?") .setMessage(message) .setPositiveButton("删除", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Toast.makeText(WebView04_Activity.this, "确定删除", Toast.LENGTH_SHORT).show(); result.confirm(); } }) .setNegativeButton("取消", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Toast.makeText(WebView04_Activity.this, "取消删除", Toast.LENGTH_SHORT).show(); result.cancel(); } }).create(); dialog.show(); return true; } @Override public void onReceivedTitle(WebView view, String title) { WebView04_Activity.this.setTitle(title); super.onReceivedTitle(view, title); } } }
五、使用 JavaScript 调用 Android
前面我们说了如何通过 Android 调用 JavaScript 的操作,反过来, JavaScript 程序也可以调用 Android 成词,此时就必须依靠 WebView 中的 addJavaScriptInterface() 方法完成,定义如下:
Public void addJavaScriptInterface(Object 操作对象 ,String 标记名称 )
在此方法中,用户需要一个标记的名称,而该标记名称的主要功能就是绑定 HTML 与 android 间的联络标记
WebView05_Activity.java
package com.iflytek.demo; import android.app.Activity; import android.os.Bundle; import android.webkit.WebView; public class WebView05_Activity extends Activity { private WebView webview = null; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); this.webview = (WebView) super.findViewById(R.id.webview); this.webview.getSettings().setJavaScriptEnabled(true); // 启用JavaScript this.webview.getSettings().setBuiltInZoomControls(true); // 控制页面缩放 this.webview.addJavascriptInterface(this, "xdwangandroid"); this.webview.loadUrl("file:/android_asset/html/show_js.html"); } public String getContent() { return "ITEYE:www.iteye.com"; } }
show_js.html
<head> <title>Iteye:www.iteye.com</title> <meta http-equiv="Content-Type" content="text/html ; charset=GBK"> </head> <h1> <span id="msg">等待接收信息...</span> </h1> <script language="javascript"> document.getElementById("msg").innerHTML = window.xdwangandroid.getContent(); </script>
发表评论
-
This version of ADT requires android SDK
2013-07-25 16:45 1541Windows系统下用Eclipse开发工具开发An ... -
Android学习13-----网络通信(3) 与Web Service进行通讯
2012-11-26 09:40 1858这里我们的WebService使用xFire开发。 ... -
Android学习13-----网络通信(2) 与Socket交换数据
2012-11-23 09:11 3267对于网络开发而言,最常用的交互模式:WebService、We ... -
Android学习13-----网络通信(1) 与WEB服务器交换数据
2012-11-22 09:11 2158与Web服务器交互: 如果手机要想与 web ... -
Android学习11-----多媒体技术(5) 媒体录制
2012-11-16 08:10 1846在Android中通过android.media ... -
Android学习11-----多媒体技术(4) 使用摄像头拍照,多点触控
2012-11-15 08:37 2834一、摄像头拍照 前面说媒体播放 时了解了 ... -
Android学习11-----多媒体技术(3) 媒体播放
2012-11-14 08:25 1380在 Androi ... -
Android学习11-----多媒体技术(2) Animation
2012-11-13 08:47 1955一、渐变动画, Tweened Animation ... -
Android学习11-----多媒体技术(1) 绘制简单图形,Bitmap,Matrix
2012-11-12 08:48 1568一、绘制简单图 ... -
Android学习12-----手机服务(4) 传感器
2012-11-19 09:13 1986传感器一般用于游戏中,在 Android 系统中为 ... -
Android学习12-----手机服务(1) 取得电池电量和声音服务:AudioManager
2012-11-18 11:18 3430一、取得电池电量信息 ... -
Android学习10-----Android组件通信 (8) 桌面显示组件:AppWidget
2012-11-02 08:36 2001一、 AppWidget 在使用 Androi ... -
Android学习10-----Android组件通信 (7) 广播机制:Broadcast
2012-11-01 08:43 1480一、 广播: 广播也是一种信息的发送机制,在 ... -
Android学习10-----Android组件通信 (6) PendingIntent
2012-10-31 08:20 2206Intent 的主要功能是表示用 ... -
Android学习10-----Android组件通信 (5) Service
2012-10-30 08:25 1679Service 基本组成: ... -
Android学习10-----Android组件通信 (4) 消息机制
2012-10-29 08:22 1513在 Android 操作系统中存在着消息队列的操作 ... -
Android学习10-----Android组件通信 (3) ActivityGroup
2012-10-26 08:23 2264导航栏在 Android 中的应用是很常见的,前面 ... -
Android学习10-----Android组件通信 (2) Activity生命周期
2012-10-25 08:16 1248Activity 是整个 Android 平台的基 ... -
Android学习10-----Android组件通信 (1) Intent
2012-10-24 08:43 1929在一个项目之中,会由多个 Activity ... -
Android判断是否有网络连接
2013-04-25 16:34 1402Android中判断有时候因为功能的需求,需要判断是否有网络 ...
相关推荐
这是一个集成目前Android主流优秀第三方组件、优秀好用的自定义控件、实用工具类封装、以及一些APP共通模块(比如:版本更新、意见反馈、引导界面等等)的开发包,帮助程序员快速开发自己的APP 已集成第三方开源...
目录 WebView简单介绍 提示:WebView组件的最大用途 android.webkit.WebView的继承结构如下: 了解本专栏 订阅专栏 解锁全文 作者:luminal_Andy
8.1.2 Android网络基础 8.2 HTTP通信 8.2.1 HttpURLConnection接口 8.2.2 HttpClient接口 8.2.3 实时更新 8.3 Socket通信 8.3.1 Socket基础 8.3.2 Socket应用(简易聊天室) 8.4 网络通信的中文乱码问题 8.5 WebKit...
这是一个集成目前Android主流优秀第三方组件、优秀好用的自定义控件、实用工具类封装、以及一些APP共通模块(比如:版本更新、意见反馈、引导界面等等)的开发包,帮助程序员快速开发自己的APP 已集成第三方开源...
8.1.2 Android网络基础 8.2 HTTP通信 8.2.1 HttpURLConnection接口 8.2.2 HttpClient接口 8.2.3 实时更新 8.3 Socket通信 8.3.1 Socket基础 8.3.2 Socket应用(简易聊天室) 8.4 网络通信的中文乱码问题 8.5 WebKit...
8.1.2 WebView组件 8.1.3 HttpURLConnection 8.2 Socket编程 8.3 数据的解析 8.3.1 JSON数据解析 8.3.2 XML数据解析 8.4 Web Service访问 8.5 小结 练习 第9章 多媒体应用 9.1 音频与视频的播放 ...
这是一个集成目前Android主流优秀第三方组件、优秀好用的自定义控件、实用工具类封装、以及一些APP共通模块(比如:版本更新、意见反馈、引导界面等等)的开发包,帮助程序员快速开发自己的APP 已集成第三方...
8.1.2 Android网络基础 8.2 HTTP通信 8.2.1 HttpURLConnection接口 8.2.2 HttpClient接口 8.2.3 实时更新 8.3 Socket通信 8.3.1 Socket基础 8.3.2 Socket应用(简易聊天室) 8.4 网络通信的中文乱码...
8.1.2 Android网络基础 8.2 HTTP通信 8.2.1 HttpURLConnection接口 8.2.2 HttpClient接口 8.2.3 实时更新 8.3 Socket通信 8.3.1 Socket基础 8.3.2 Socket应用(简易聊天室) 8.4 网络通信的中文乱码...
13.1 基于TCP协议的网络通信 477 13.1.1 TCP协议基础 477 13.1.2 使用ServerSocket创建 TCP服务器端 478 13.1.3 使用Socket进行通信 479 13.1.4 加入多线程 483 13.2 使用URL访问网络资源 488 ...
Webview WebView(网络视图)能加载显示网页,可以将其视为一个浏览器。它使用了WebKit渲染引擎加载显示网页 Activity Activity是一个应用程序组件,提供一个屏幕,用户可以用来交互为了完成某项任务,是一个负责与...
13.1、基于TCP协议的网络通信(套接字Socket):Socket; ServerSocket; 13.2、使用URL访问网络资源:URL; URLConnection; 13.3、使用HTTP访问网络:HttpURLConnection; HttpClient; 13.4、使用WebView视图显示网页...
13.1 基于TCP协议的网络通信 477 13.1.1 TCP协议基础 477 13.1.2 使用ServerSocket创建TCP 服务器端 478 13.1.3 使用Socket进行通信 479 13.1.4 加入多线程 483 13.2 使用URL访问网络资源 489 13.2.1 使用URL读取...
13.1 基于TCP协议的网络通信 477 13.1.1 TCP协议基础 477 13.1.2 使用ServerSocket创建TCP 服务器端 478 13.1.3 使用Socket进行通信 479 13.1.4 加入多线程 483 13.2 使用URL访问网络资源 489 13.2.1 使用URL读取...
13.1、基于TCP协议的网络通信(套接字Socket):Socket; ServerSocket; 13.2、使用URL访问网络资源:URL; URLConnection; 13.3、使用HTTP访问网络:HttpURLConnection; HttpClient; 13.4、使用WebView视图显示网页...