mButton.setBackgroundColor(Color.GREEN) ;
So, I used that method to change the color of a button when it's clicked. Button was initialized like private in MainActivity and this in onCreate():mButton = (Button) findViewById( R.id.button_count);
I tried to cast it to View and still doesn't work. Maybe, it can help you - when I set any color in Attribute Pane attribute background, color of a button doesn't change.
I want to know how to change background color in java code or what's wrong with my program. Thank you