Search code examples
javaandroidjquerybackground-colorapp-inventor

Android set label color based on button click


I know that this should be pretty easy but I am stucked.

Trying to make an apliaction where have + and - button that should represents rasing and lowering of power. Than have 4 label and trying to change background color of that label when the + or - button clicked.

Background error

The problem is that when I clic + button it stops on 2nd label and when try to - button it stops on 1st label. Whatmore it shows error in sreen inicialization component but I think there is everythink ok.

Can any one help me to solve it?


Solution

  • I believe the reason that you are getting an error is because when you select from the list, you set the "value if tag not there" to an integer, when the background color expects a color. Try changing the numbers for the value if tag not there to a default color.