Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Styling with HTML markup, it's not work in strings.xml

Styling with HTML markup, it's not work in strings.xml and I don't know, why.

<string name="autores">This aplication is developed by <i>Charles</i></string>

And it set the phrase without italic way in the word Charles. What could it be the problem?

Thanks a lot

like image 341
marioerro Avatar asked Feb 16 '23 07:02

marioerro


1 Answers

Solution:

You can use CDATASection.

Example:

<string name="autores">
<![CDATA[
This application is developed by <i>Charles</i>
]]>
</string>

and

dialog.setMessage(Html.fromHtml(this.getString(R.string.autores)));

Reference:

CDATASection

I hope it will be helpful !!

like image 156
Mehul Joisar Avatar answered Feb 27 '23 18:02

Mehul Joisar