public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
WebView mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setUseWideViewPort(true);
//放大缩小
mWebView.getSettings().setBuiltInZoomControls(true);
//适应全屏按比例缩放 可通过修改 39这个参数来设置适应屏幕的尺寸
mWebView.setInitialScale(39);
mWebView.loadUrl("http://www.wwgupiao.com/game/");
mWebView.setWebViewClient(new WanWeiWebViewClient());
}
private class WanWeiWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}