Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quotation marks not shown on display

Tags:

html

android

xml

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 &quot;text&quot; 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 &lt;i>text&lt;/i>, and that works just fine. What's wrong?

like image 726
gosr Avatar asked Dec 06 '22 23:12

gosr


2 Answers

Try this:

<string name="infoHeader">random \"text\" here</string>
like image 170
Vit Khudenko Avatar answered Jan 07 '23 13:01

Vit Khudenko


Try this:

  Value:  \"Hello\" 

in the resources window, or

<string name="hello">\&quot;Hello\&quot;</string>

in the xml file

like image 45
f20k Avatar answered Jan 07 '23 15:01

f20k