Android XML escape “@” Symbol

cRoNiC

New Member
How do you use the \[code\]@\[/code\] as text in an Android XML file, as it has special meaning? I have a \[code\]TextView\[/code\] which will simply hold the text \[code\]@\[/code\]I tried:\[code\]<TextView android:id="@+id/at_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_toRightOf="@id/account_name" android:gravity="center_horizontal" android:padding="3dip" android:text="@" />\[/code\]That of course did not work with the error \[quote\] error: Error: No resource type specified (at 'text' with value '@').\[/quote\]So I tried pointing it to an entry in \[code\]strings.xml\[/code\] like this:\[code\]<string name="at">@</string>\[/code\] and that shows the error:\[quote\] error: Error: No resource type specified (at 'at' with value '@').\[/quote\]So how do I escape \[code\]@\[/code\] as the text for a TextView?
 
Back
Top