I need the background to turn green when the button is clicked, many tutorials say to use:
backgroundView.setBackgroundColor(Color.GREEN) but it doesn't work.

It shows an error: Type mismatch: inferred type is Color but Int was expected Can't understand what to do and why doesn't it work in my case. Thank you

Points to remember:
The
Colorclass shouldimport android.graphics.Colorand color GREEN should be in caps or you can use custom color from your colors.xml file usinggetColor()method