I have some clickable views and I want to set the default available background that is present on list click (in ICS is a blue color). I have tried putting as background thi
This works fine on api 11 and above. But as noted it wont work on previous versions.
android:background="?android:attr/selectableItemBackground"
Here is a solution to have it run on all versions running android.
Add the appropriate colors within the colors.xml which is located within your values folder. It should appear as such:
#ffffff
#7ecce8
Create an xml selector file. Here I named it button_selection.xml
Go to your view or button and set the newly created button_selection.xml as its background.
android:background="@drawable/button_selection"