android webview加载String类型html

 

今天遇到解析json的时候html是String类型的,如下是解决方法:

 

 

	webView = (WebView) findViewById(R.id.bbs_webview);
        webView.getSettings().setJavaScriptEnabled(true);
        special_content = special_content.replaceAll("&", "");
        special_content = special_content.replaceAll(""", "\"");
        special_content = special_content.replaceAll("<", "<");
        special_content = special_content.replaceAll(">", ">");
        special_content = special_content.replaceAll("\\n", "
");//换行 special_content = special_content.replaceAll("webView = (WebView) findViewById(R.id.bbs_webview); webView.getSettings().setJavaScriptEnabled(true); special_content = special_content.replaceAll("&", ""); special_content = special_content.replaceAll(""", "\""); special_content = special_content.replaceAll("<", "<"); special_content = special_content.replaceAll(">", ">"); special_content = special_content.replaceAll("\\n", "
");//换行 special_content = special_content.replaceAll("

 

 

 

 

 

你可能感兴趣的:(安卓,android)