So i have this in Strings.xml:
<string name="sixpackInfo">
<html><body><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero. </p>
<p><b>Sed dignissim lacinia nunc. Curabitur tortor.</b> Pellentesque nibh. Aenean quam. In sce
</body></html>
</string>
我尝试将这个字符串加载并解析到Webview中。
就像这样:
wvInformation = (WebView) findViewById(R.id.wvInformation);
String text = getResources().getString(R.string.sixpackInfo);
System.out.println(text);
wvInformation.loadData(text, "text/html", null);
我将Lorem Ipsum文本输入到webview中,但是p标签和b标签没有被处理。该文本只会显示为带标记的纯文本。