'android:state_selected="true" is not working for LinearLayout

android:state_selected="true" is not working for my LinearLayout, I have selector for selected and pressed states, pressed works fine, while selected does not. I have android:clickable="true", android:focusable="true" and android:focusableInTouchMode="true" for my LinearLayout though.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source