Java – Android layout files do not allow characters such as &, <, >

When I try to use &, <, > as main XML and strings XML, which returns an error I want to mean "&" and "<" sign in text view in my application anyway How do you do it? Please give me some advice Thank you in advance

Solution

As @ wellog said, you need five XML escape sequences:

"   &quot;
'   &apos;
<   &lt;
>   &gt;
&   &amp;

Resources: XML document escape characters

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>