I am newbie in android. When I am getting the data from an URL then parse the HTML data and show the page contents using loadDataWithBaseURL()
.
But it's showing all data with the same formatting.
I used HTML tags in data.
The paragraph tag <p>
and other tags are working fine, but the bold tag is not showing the contents in bold. I used <b>
and </b>
for bold.
How to show bold content as bold?
Here is the java code.
final String ftext = "<html><body>"+ Html.fromHtml(storyText)+ " </body></html>";
webview.getSettings().setJavaScriptEnabled(true);
webview.loadDataWithBaseURL("", ftext, "text/html", "UTF-8", "");
webview.setVisibility(View.VISIBLE);
This is the headline
other story headline
.
whole story
.