Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using an @ symbol in strings.xml

Tags:

android

How would one use an @ symbol inside a string in strings.xml?

<string name="twitter">@npike</string>

The XML editor gets rather angry:

error: Error: No resource type specified (at 'twitter' with value '@npike').
like image 250
NPike Avatar asked Dec 30 '11 20:12

NPike


2 Answers

I would suggest use unicode like \u0040 instead of '@' symbol. XML processing doesn't like special symbols. Here is list of special characters and it's unicode valuesSpecial characters and unicode values

like image 93
kosa Avatar answered Nov 16 '22 01:11

kosa


Use this instead :

<string name="twitter">\@npike</string>
like image 39
Vishnu Avatar answered Nov 16 '22 01:11

Vishnu