Android: Webview的简单使用,WebViewClient(2)

如果希望点击链接由自己处理,而不是新开Android的系统browser中响应该链接。
给WebView添加一个事件监听对象(WebViewClient) 
并重写其中的一些方法
shouldOverrideUrlLoading:对网页中超链接按钮的响应。

当按下某个连接时WebViewClient会调用这个方法,并传递参数

根据按下的链接,发送请求,得到返回的responseCode 的值,根据responseCode 值,向下传递不同的url;

onLoadResource 
onPageStart 
onPageFinish 
onReceiveError
onReceivedHttpAuthRequest

你可能感兴趣的:(Android: Webview的简单使用,WebViewClient(2))