Create the attars.xml file under the values ββfolder.
In the attars.xml file, create an element for selectableItemBackground:
<?xml version="1.0" encoding="utf-8"?> <resources> <attr name="selectableItemBackground" format="reference" /> </resources>
In your styles.xml file, specify this attribute with drawable:
<item name="selectableItemBackground">@drawable/yourDrawable</item>
And then in your drawing-capable file, reference the attribute:
<item android:drawable="?attr/selectableItemBackground"/>
source share