Hello I want to do this: I am pulling data from a server and I need when for example pull out the number 0 the textview to ber red color, on any other case to be green color. I do not know if there is a way of placing something like an if statement in the xml file or somewhere else.
Share
You need to to first instantiate your text view like
Now you can perform change this text view as you please . For example
This is the way you need to change the features of views dynamically . You can’t really change the XML itself dynamically .
All this must be performed in the Java class .