Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display double quotes(") Symbol in a TextView?

Tags:

android

I'm trying to display some words in double quotes, in Text view in in xml file. But its not working. Pls help me.

    <TextView      style="@style/TextStyle"      android:text="message "quote string 1" and "quote string 2" end message"      android:id="@+id/lblAboutPara3"      android:autoLink="web"/>     

Any one knows solution for this.............

like image 465
Vignesh Avatar asked Jun 21 '11 06:06

Vignesh


People also ask

How do you show text in double quotes?

to show double quote you can simple use escape character("\") to show it.

How do you insert a double quote?

The keyboard shortcut for the double quotation mark symbol is shift + first key on the left side of ENTER. For windows, the double quotation mark sign alt code is 34.

How do you show quotes in a string?

Let's say you're trying to use quotation marks inside a string. You'll need to use opposite quotation marks inside and outside of JavaScript single or double quotes. That means strings containing single quotes need to use double quotes and strings containing double quotes need to use single quotes.


1 Answers

In the strings.xml, you can simply escape special characters (eg double quotes) with a backslash :

"message \"quote string 1\" and \"quote string 2\" end message" 

But in views xml (eg layout.xml), you have to use HTML character entities (like &quot;) :

"message &quot;quote string 1&quot; and &quot;quote string 2&quot; end message" 

For more, visit http://developer.android.com/guide/topics/resources/string-resource.html

like image 175
louiscoquio Avatar answered Sep 19 '22 11:09

louiscoquio