Hi I\'m trying to make my linear layout work like button. I mean I\'m trying to change its background color when the state is changed. I used selector to solve it, but it didn\'
Although this question has answer I am writing this to clarify and give my observation.
answer by @minelight does not work on views that are not clickable, for example LinearLayout and TextView. The statePressed state is available only for clickable views.
The second answer actually completes the first one.