In my string xml file I have a line like this:
<string name="infoHeader">random "text" here</string>
But it is only displayed as
random text here
on the phone's display, that is, without the quotation marks.
I read about it via Google, and tried some HTML styling:
<string name="infoHeader">random "text" here</string>
And then used:
String hej = res.getString(R.string.infoHeader);
Spanned marked_up = Html.fromHtml(hej);
((TextView)findViewById(R.id.infoHeader)).setText(marked_up, BufferType.SPANNABLE);
But it still doesn't work. I tried some other HTML, like <i>text</i>
, and that works just fine. What's wrong?
Try this:
<string name="infoHeader">random \"text\" here</string>
Try this:
Value: \"Hello\"
in the resources window, or
<string name="hello">\"Hello\"</string>
in the xml file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With