安卓webView加载HTML数据
来源:互联网 发布:手机版ps软件 编辑:程序博客网 时间:2024/05/22 04:52
import android.os.Bundle;import android.support.v7.app.AppCompatActivity;import android.webkit.WebSettings;import android.webkit.WebView;public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String html="<title>TextView使用HTML</title>"; WebView descriptionView=(WebView) this.findViewById(R.id.Webview); WebSettings ws = descriptionView.getSettings(); ws.setJavaScriptEnabled(false); ws.setAllowFileAccess(true); ws.setBuiltInZoomControls(false); ws.setSupportZoom(false); ws.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); ws.setDefaultTextEncodingName("utf-8"); //设置文本编码 ws.setAppCacheEnabled(true); ws.setCacheMode(WebSettings.LOAD_DEFAULT);//设置缓存模式</span> descriptionView.loadDataWithBaseURL(null,html, "text/html", "utf-8",null); }}
0 0
- 安卓webView加载HTML数据
- 安卓webview无法加载html页面
- 安卓如何使用WebView组件加载HTML代码
- 安卓如何使用WebView组件加载HTML代码
- iOS开发 webView加载html数据
- WebView加载服务器返回的html数据
- 安卓webView开发使用及加载html标签乱码处理
- WebView--安卓与HTML的交互
- 安卓app单webview改为多webview加载网页
- webview加载html
- WebView加载本地HTML
- webview 加载本地html
- webview加载html内容
- 应用webview加载Html
- WebView 加载 html
- WebView加载html文件
- webview加载html优化
- webview加载html
- Android 标题栏沉浸式的实现
- MapReduce:详解Shuffle过程
- IPHONE,zlib库编译iphone版本
- 关于如何连接阿里云服务器上的MySQL数据库的解答
- puppet的第一个自己写的模块
- 安卓webView加载HTML数据
- pl/sql 过程 函数
- 0/1背包问题
- IE(IE6/IE7/IE8)支持HTML5标签
- ckeditor+ckfinder 由于文件系统的限制,该请求不能完成
- 杭电acm-sum number
- Error: Library projects cannot set applicationId. applicationId is set to "com.du.android.recyclervi
- 【转】自己总结的web前端知识体系大全
- 技术人生,从此记录成长的点滴