只让本应用程序的webview加载网页,而不调用外部浏览器打开的办法就是:设置WebViewClient,并重写WebViewClient的shouldOverrideUrlLoading方法返回true
mWebView.setWebViewClient(new WebViewClient(){ @Override public boolean shouldOverrideUrlLoading(WebView view, String url) { // TODO Auto-generated method stub view.loadUrl(url); return true; } });
/** 。。。。。。。 * @param view The WebView that is initiating the callback. * @param url The url to be loaded. * @return True if the host application wants to leave the current WebView * and handle the url itself, otherwise return false. */ public boolean shouldOverrideUrlLoading(WebView view, String url) { return false; }
【android】只让本应用程序的webview加载网页而不调用外部浏览器的办法
原文地址:http://blog.csdn.net/u011494050/article/details/41512777