I'm trying to set the text of a button to "<<<" from my xml but I get an "Error:(20) Error parsing XML: not well-formed (invalid token)"
<Button
android:id="@+id/test"
android:text="<<<"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
So I jumped over to my strings.xml to enter it in there and that clearly won't work.
<string name="abc"> <<< </string>
Is there a workaround for this?
These are html entities, works in android studio as well:
> can be replaced with >
< can be replaced with <
" can be replaced with ", “ or ”
' can be replaced with ', ‘ or ’
} can be replaced with }
& can be replaced with &
space can be replaced with  
Use >
for >
, <
for <
, &
for &
,'
for '
, "
for "
You can use
< (less-than) < or <
> (greater-than) > or >
& (ampersand) & or &
' (apostrophe or single quote) ' or '
" (double-quote) " or "
please check out these links :
Predefined entities in XML
Using Special Characters in XML
Stackoverflow - escaping special characters like & in android xml