@npike The XM...">

Using the @ character in strings.xml

How to use the @ character inside a string in strings.xml?

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

The XML editor gets pretty angry:

 error: Error: No resource type specified (at 'twitter' with value '@npike'). 
+8
android
source share
3 answers

Use this instead:

 <string name="twitter">\@npike</string> 
+25
source share

I would suggest using unicode as \ u0040 instead of the '@' character. XML processing does not like special characters. Here is a list of special characters and unicode values Special characters and Unicode values

+5
source share

Try it with the backslash "\ @". This works for quotes. You cannot use XML objects in strings.xml, otherwise I would recommend this.

+2
source share

All Articles