1XML文件android
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"></WebView>web
2代碼實現ide
webview = (WebView) inflate.findViewById(R.id.webview);
webview.loadUrl("https://hao.360.cn/?wd_xp1");
webview.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});url