Android中如何显示本地HTML

/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");

你可能感兴趣的:(html,android,String,File,encoding)