How do you use the @ as text in an Android XML file, as it has special meaning? I have a TextView which will simply hold the text @
I tried:
<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="@" />
That of course did not work with the error
error: Error: No resource type specified (at ‘text’ with value ‘@’).
So I tried pointing it to an entry in strings.xml like this:
<string name="at">@</string> and that shows the error:
error: Error: No resource type specified (at ‘at’ with value ‘@’).
So how do I escape @ as the text for a TextView?
use this way …………..