I'm doing some age calculation using spinner. I've added string array to it. In my string array in string.xml, I key in the value
<string-array name="arrayAge">
<item> < 40 </item>
<item> >=40 </item>
</string-array>
However, I met with error at <40. Can anyone tell me how should I format it, if I want to display <40?
You need to use < if you want to display < character. The reason for it is that in XML, < is the beginning of the closing tag and the parser wouldn't know how to distinguish that.
To display >, use >.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With