main.xml中布局webview,activity中设置如下
MyWebView=(WebView)findViewById(R.id.webView1);
MyWebView.requestFocus();
//MyWebView.getSettings().setJavaScriptEnabled(true);
WebSettings webSettings=MyWebView.getSettings();
webSettings.setAllowFileAccess(true);
//设置支持缩放
webSettings.setBuiltInZoomControls(true);
//加载需要显示的网页
MyWebView.loadUrl("file:///android_asset/pages/js/main.html"); //加载页面,,,也可换位具体的网址
// MyWebView.addJavascriptInterface(new Object(), "contact");