private WebView wv;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
wv = (WebView) findViewById(R.id.wv1);
wv.loadUrl("");
wv.setWebViewClient(new WebViewClientDemo());
}
private class WebViewClientDemo extends WebViewClient {
@Override
// 在WebView中而不是默认浏览器中显示页面
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
阅读(2404) | 评论(0) | 转发(0) |