How do i change the color of a Relative Layout i use as a clickable on Click like the normal Button? Like i want a visual feedback the layout was pressed.
I tried it with a selector bound to the background property like this:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:color="@android:color/black"/>
<item android:state_pressed="true" android:state_enabled="false" android:color="@android:color/black" />
<item android:color="@android:color/white"/>
</selector>
and used it in the Layouts backround...
android:background="@color/layout_selector"
but this gives me an Inflate Exception...
Any ideas?
See Question&Answers more detail:os