We tin flaming occupation picture every moment push clit background when the push clit is clicked/selected/pressed. Here I bring added novel color value which is visible piece pressing the button.
This is real unproblematic task, for this nosotros bring to exercise an XML file inwards drawable folder as well as adding but about XML code.
Android Example: How to Make Button Selector inwards Android
Let’s starting fourth dimension past times creating novel XML file called button_selector_effect.xml inwards res/drawable folder. Following is the consummate content of drawable XML file.
Following are the unlike color values of colors.xml file.
XML Layout File
Here I bring added 1 push clit amongst background attribute as well as used background every moment to a higher house XML drawable file that nosotros bring created before. Following is the consummate content of XML layout file.
Java Activity File
Default code of coffee activeness file volition await similar below.
Now, run your Android Button Selector Example application as well as click the button, y’all volition run across unlike color when y’all press/click the push clit as well as thus default color which volition await similar to a higher house screenshot.