I have a button that has a drawable XML file set as the background, this is so that when the button is pressed the background colour and outline of the button is change. However it does not stay like this, after a second it goes back to what it is before. How do I get it to stay with the changed colours until a different button is pressed?
<item android:state_pressed="true" > <shape> <solid android:color="#99000000" /> <stroke android:width="1dp" android:color="#489d73" /> </shape> </item> <item> <shape> <gradient android:startColor="#66000000" android:endColor="#66000000" android:angle="270" /> </shape> </item>
Create background drawables for each button state. Then when clicking another button change view's background programmatically.
If you want the button to keep its color until you change it, you have to change its background programatically.