团队冲刺9

1.新闻游览界面部分代码

private void initview() {
title=findViewById(R.id.datail_title);
time=findViewById(R.id.datail_time);
place=findViewById(R.id.datail_place);
author=findViewById(R.id.datail_author);
web=findViewById(R.id.web);
Intent intent = this.getIntent();
Bean bean=(Bean) intent.getSerializableExtra("bean");
title.setText(bean.getTitle());
time.setText(bean.getTime());
place.setText(bean.getPlace());
author.setText(bean.getAuthor());
String data=bean.getContent();
web.getSettings().setJavaScriptEnabled(true);//启用js
web.getSettings().setBlockNetworkImage(false);//解决图片不显示
web.getSettings().setDomStorageEnabled(true);
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP){
web.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
}
web.loadDataWithBaseURL("about:blank",data,"text/html","utf-8",null);
}
posted @ 2021-05-09 16:01  chenghaixinag  阅读(20)  评论(0编辑  收藏  举报