title: Android LinearLayout Selector background color
body: <p>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't work.</p>
  
  <p>I looked for solutions and all they say was add clickable attribute.
  I've already done that.</p>
  
  <p>My LinearLayout contains two LinearLayout which contains 9 TextViews each.
  They fill my LinearLayout fully.</p>
  
  <p>What I thought of was that its child is absorbing the click event and my LinearLayout doesn't change its state to pressed.</p>
  
  <p>So I put clickable and focusalbe attribute to false on every child of my LinearLayout.</p>
  
  <p>However, it's still same.</p>
  
  <p>Here's my code.</p>
  
  <p>This is the selector jbbtn.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android" &gt;
      &lt;item android:state_enabled="true" android:state_pressed="true"
           android:drawable="@drawable/jbbtn_pressed"/&gt;
      &lt;item android:state_enabled="true" 
           android:drawable="@drawable/jbstyle_transparent"/&gt;
      &lt;item android:state_enabled="false" android:drawable="@drawable/jbbtn_disabled"/&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>And This is My LinearLayout</p>
  
  <pre><code>&lt;LinearLayout
      android:id="@+id/llCurrents"
      android:background="@drawable/jbbtn"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_alignParentBottom="true"
      android:layout_alignParentLeft="true"
      android:layout_alignTop="@+id/llTimer"
      android:layout_below="@id/btnMenu"
      android:layout_marginRight="3sp"
      android:clickable="true"
      android:focusable="true"
      android:orientation="horizontal"
      android:padding="3sp" &gt;
  
      ~~~~~~
  
  &lt;/LinearLayout&gt;
  </code></pre>