标签:android c style code a http
mWebView.setWebViewClient(new
WebViewClient(){
public
boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
假如不做任何处置,阅读页面,点击体系“Back”键,整个Browser会调用finish()而结束本身,假如期望阅读的网
页回退而不是推出阅读器,需求在当时Activity中处置并花费掉该Back事情。
public boolean onKeyDown(int keyCode,
KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) &&
mWebView.canGoBack()) {
mWebView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
Android调用WebView,布布扣,bubuko.com
标签:android c style code a http
原文地址:http://www.cnblogs.com/haomad/p/3776519.html