tags:

views:

57

answers:

1

I'm looking for a way to escape the "@" symbol at the start of a string, in Android strings.xml resource. I'm continuously getting compilation errors and the layout builder in Eclipse refuses to work :(. Does anyone know how?

A: 

You should use the "\" before "@". eg

escaped\@ 

:-)

Ravi Vyas
If I put <string name="twitter">\@mytwitter</string>, I still have a compilation error. Do you have another workaround?
patgrdj
I assume you have, but just in case: have you tried "/"?
raybritton
I just tried your string in my strings.xml , it works , whats the exact error you are getting?
Ravi Vyas
No more compilation errors. However, it displays the backslash character. I got something working with <string name="twitter">\ @mytwitter</string> (a space between "\" and "@"). Thanks for your help!
patgrdj