0
I have a menu, with 3 buttons, and I need to change their color dynamically in code.
I’m currently doing it this way:
mDrawable.setColorFilter (0xff0099cc, PorterDuff.Mode.SRC_IN);
What happens is that it correctly applies the color button, but when I change Activity and click another button, the first button that is activated always stays with the color as if it were still activated. *This menu is included in the three activitys.
In the image below represents what happens, when I click on another button, it activates the other but the first remains with the color yet.
When you change the color of a button you have to return the original color to the other buttons
– ramaral
@ramaral, even when I change Activity and everything is recreated? See that the color of the text Home, back to normal... just the icon that does not...
– Mateus Carvalho
Not in principle, if indeed everything is recreated. You would have to see the code to know if in fact "everything is recreated".
– ramaral
From what I understand well... you are opening an Activity when the click on the button is made?
– itscorey