Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android xml Textview text attribute cannot take '<' as value

Tags:

text

android

xml

I cannot type

   <Button
        android:id="@+id/del"
        android:text="<"
        android:textColor="#FFFFFF"/>

it gives an error

Error:(317) Error parsing XML: not well-formed (invalid token)

like image 275
Yunus Sımsıkı Avatar asked Mar 29 '26 15:03

Yunus Sımsıkı


1 Answers

Do it like this in the XML:

<Button
    android:id="@+id/del"
    android:text="&lt;"
    android:textColor="#FFFFFF"/>

Programmatically:

button.setText("<");
like image 160
daniel.keresztes Avatar answered Mar 31 '26 03:03

daniel.keresztes