/one
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("content://com.android.htmlfileprovider/sdcard/index.html");
//two
Uri uri = Uri.parse("content://com.android.htmlfileprovider/sdcard/01.htm");
Intent intent = new Intent();
intent.setData(uri);
intent.setClassName("com.android.htmlviewer", "com.android.htmlviewer.HTMLViewerActivity");
startActivity(intent);
//three
String encoding = "UTF-8";
String mimeType = "text/html";
final String html =
"<p><a href=/"file:///sdcard/web/acdf2705/">链接google</a></p>"+
"<p><a href=/"file:///sdcard/ebook/user_defined/browser/localweb//532fa8dc/"& gt;链接google</a></p>";
mWebView.loadDataWithBaseURL("file://", html,mimeType, encoding, "about:blank");
Android中如何显示本地HTML
最新推荐文章于 2021-11-29 14:07:09 发布