I know I can put escaped HTML tags in string resources. However, looking at the source code for the Contacts application I can see that they have a way of not having to enco
I know this is an old question but it seems the most efficient answer has not been proposed yet.
Just use HTML-escaped characters so it won't get processed by getString but it will be processed by HtmlCompact.fromHtml (or the older Html.fromHtml).
This also supports more tags like HTML links etc., not only formatting like getString method.
For example something like this should work:
Hello <b>World</b>.
val text = getString(R.string.html_message)
val result = HtmlCompact.fromHtml(text, HtmlCompat.FROM_HTML_MODE_LEGACY)
In your case you replace < with < like this:
<font fgcolor="#ffffffff">Sync your Google contacts!</font> \nAfter syncing to your phone, your contacts will be available to you wherever you go.