url = getIntent().getStringExtra("url");
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setDefaultTextEncodingName("GBK");
settings.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
settings.setAppCacheEnabled(true);
webView.setScrollBarStyle(0);
webView.loadUrl(url);
webView.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onJsAlert(WebView view, String url, String message, JsResult result) {
if (message != null) {
Toast.makeText(mContext, message, Toast.LENGTH_LONG).show();
}
<span style="white-space:pre"> </span>return true;
}
});
}