Settings the text in android is done by finding the object you wish to change, and then using its setText property. Below shows my code updating a textview by its id score_text to say “boring regular text”
((TextView)this.findViewById(R.id.score_text)).setText("boring regular text \n")
This is good but what if you want to include styling in your text, so bold emphasis or italics. Well it’s very simple we first add the android.text.html include:
and then surround our code in Html.fromHtml() this causes them html styling to modify our text.
Below shows a screenshot of the regular styling and the html styling in an android application.