无法将按钮文本设置为“<<<”

我试图从我的xml中将按钮的文本设置为“<<<”,但我得到一个“错误:(20)解析XML时出错:格式不正确(无效令牌)”

<Button android:id="@+id/test" android:text="<< 

所以我跳到我的strings.xml进入那里,这显然不起作用。

  <<<  

这有解决方法吗?

这些是html实体,也可以在android studio中使用:

 > 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   

使用> for ><<& for &'''"

您可以使用

 < (less-than) < or < > (greater-than) > or > & (ampersand) & or & ' (apostrophe or single quote) ' or ' " (double-quote) " or " 

请查看以下链接:

XML中的预定义实体

在XML中使用特殊字符

Stackoverflow – 在android xml中转义特殊字符,如&