【发布时间】:2017-01-19 14:50:14
【问题描述】:
myWeb = (WebView) findViewById(R.id.webView1);
myWeb.getSettings().setJavaScriptEnabled(true);
myWeb.getSettings().setDomStorageEnabled(true);
myWeb.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
activity.setProgress(progress * 1000);
}
});
myWeb.loadUrl("/mnt/extSdCard/THEWEB/hi.html");
//file:///android_asset/this.html 可以在 webview 中运行,但不能在 externalbrowser ///mnt/extSdCard/THEWEB/hi.html 可以运行在 外部但不在网络视图中
File file=new File("/mnt/extSdCard/THEWEB/hi.html");
Intent i = new Intent(Intent.ACTION_VIEW, Uri.fromFile(file));
i.addCategory(Intent.CATEGORY_BROWSABLE);
i.setDataAndType(Uri.fromFile(file), "application/x-webarchive-xml");
startActivity(i);
【问题讨论】:
标签: javascript java android html css