Skip to content Skip to sidebar Skip to footer

Special Chars (@, ?) As Xml-string In Android App

If i try to do things like this, it doesn't work... (empty string or no resource type error) ?@

Solution 1:

Easiest way is to quote or backslash them:

<string name="random">"?"</string>
<string name="random">\?</string>

See here and here for a bit more discussion.

Here's a larger collection of string resource gotchas.

Solution 2:

This is working for me:

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

Post a Comment for "Special Chars (@, ?) As Xml-string In Android App"