I am trying to bold a particular word in a string that is stored in strings.xml:
Here is what I would like to have it as:
Future tense: Example: I will be there at 9:00AM
I followed this: Bold words in a string of strings.xml in Android - But didn't get the results.
so I had text in strings.xml like:
<string name="futureText">Future tense: <b>Example:</b> I will be there at 9:00AM</string>
String text = Html.fromHtml(res.getString(R.string.futureText));
questionText.setText (text);
I am not getting any bold for "Example:".
Also how to get the "Example: I will be there at 9:00AM" text to next line? I know in string \n goes to next how about in html format?
What is wrong here?
No comments:
Post a Comment