WebView webView = (WebView) activity.findViewById(R.id.web1); if (webView.getUrl() == null) { webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().supportMultipleWindows(); webView.setWebViewClient(new WebViewClient()); webView.setWebChromeClient(new WebChromeClient()); webView.loadUrl("http://www.baidu.com/"); }