I have a code like this:
strings.xml
<string name="message1">Your money: <b>1000</b> <b>2000</b></string>
<string name="message2">Your money: <b>%1$s</b> <b>%2$s</b></string>
And I want to show it in a TextView
MainActivity.java
// This one will render 1000 and 2000 in bold correctly
TextView mText1 = (TextView) findViewById(R.id.message1);
mText1.setText(getText(R.string.message1));
// This one fail to render 1000 and 2000 in bold
int val1 = 1000, val2 = 2000;
TextView mText2 = (TextView) findViewById(R.id.message2);
mText1.setText(String.format(getText(R.string.message2).toString(), val1, val2));
I want to make that I can format the text in bold/italic by applying String.format to android string resource.