I was trying to make bold text within my strings.xml using the HTML tag <b> and </b> as per this answer:
<string name="name"><b>bold text here</b></string>
And then trying to set the text as follows:
TextView textview = new TextView(getActivity());
textview.setText(getString(R.string.name));
However this is not working at all, the tags are ignored and the text is displayed regularly. I have been able to make the text bold using the following method:
<string name="name"><b>bold text here</b></string>
And with this code in Java:
TextView textview = new TextView(getActivity());
textview.setText(Html.fromHtml(getString(R.string.name)));
Why will the simple HTML tags not work yet this other method works just fine?