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");
更多相关文章
- 一个简单的iPhone项目及代码
- 链接器解析多重定义的全局变量
- (64位)ubuntu 11.10编译android 2.3准备的工作
- android 自定义TextView中Html超链接点击事件详解
- Android(安卓)的实现TextView中文字链接的4种方法
- Android加载/处理超大图片神器!SubsamplingScaleImageView(subsam
- Android加载/处理超大图片神器!SubsamplingScaleImageView(subsam
- Android(安卓)Widgets
- Android(安卓)WebView 获取html iframe内部链接