I have String resource with format argument %s
<string name="string_name">Hello Mr. %s. I want to ...</string>
This string resource is localized, so has different length depending on locale and has to be in one TextView
I want to make formatArg %s bold style
I've tried html tag
<string name="string_name">Hello Mr. <b>%s</b>. I want to ...</string>
I've tried annotation tag
<string name="string_name">Hello Mr. <annotation style="bold">%s</annotation>. I want to ...</string>
I've created SpannableString and tried to set Span to this annotation
And no any effect to string argument after I set text to TextView
tvDescription.setText(getString(R.string.string_name, "formatArg"));
Is there a way to set style to the string argument in formatted string resource?
This is how i style the message of an AlertDialog:
Edit: Or maybe this is what you are looking for. Their example is this: