title: android linearlayout background selector
body: <p>I am adding some Linearlayout views in a scrollview by inflating them dynamically. I have set the background of the added LinearLayout to a selector list. But after adding to scrollview, when I press the selected view, it does not show any affect of selector list. The example XMLs I am using are:</p>
  
  <p>Selector file:    selector_file</p>
  
  <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  &lt;item android:drawable="@drawable/listbg"
        android:state_pressed="true" /&gt;
  &lt;item android:drawable="@drawable/bgsmall"/&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>And I am inflating the following view and adding to l1 Linearlayout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="horizontal"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:background="@drawable/selector_file"
  android:gravity="center_vertical"
  &gt;
  &lt;ImageView android:id="@+id/image1" android:layout_width="100dip" android:layout_height="75dip"/&gt;
  &lt;TextView android:id="@+id/textitem" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textColor="#000000"&gt;&lt;/TextView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And the ScrollView to which the above inflated views are being added is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  &gt;
  
  &lt;ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content"&gt;
      &lt;LinearLayout android:id="@+id/l1"  android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"&gt;
  
  &lt;/LinearLayout&gt;
  &lt;/ScrollView&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Any Idea...???</p>