android Custom Listview Background Focus State not working
<p>I am trying to create custom background selector for my ExpandableListView. It works fine for all states other than focused. I am unable to identify which row is currently focused. Here is the code:</p>

<p><strong>im_selector.xml</strong></p>

<pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;

    &lt;item android:state_focused="true"
        android:drawable="@drawable/list_selector_background_focus" /&gt;
    &lt;item android:state_pressed="true"
        android:drawable="@drawable/list_selector_background_pressed" /&gt;

    &lt;item 
        android:drawable="@drawable/list_bg" /&gt;

&lt;/selector&gt;
</code></pre>

<p><strong>im_list_item.xml</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/list_item"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"   
    android:background="@layout/im_selector"
    android:paddingTop="10px"
    android:paddingBottom="10px"
    android:paddingLeft="5px"    
    &gt;

    &lt;ImageView android:id="@+id/status_image"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="4px"

            /&gt;


     &lt;TextView  
              android:id="@+id/count_text"
              android:singleLine="true"
              android:layout_width="30px"
              android:layout_height="wrap_content"
              android:textColor="#fff"            
              android:layout_alignParentRight="true"
              android:background="@drawable/new_msg"
              android:padding="2px"
              android:layout_marginRight="10px"
              android:gravity="center_horizontal"
     /&gt;

     &lt;TextView  
              android:id="@+id/list_item_text"
              android:singleLine="false"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:textColor="#000"
              android:layout_toRightOf="@id/status_image"
              android:layout_toLeftOf="@id/count_text"            
     /&gt;



&lt;/RelativeLayout&gt;
</code></pre>

<p>and the listview:</p>

<pre><code>&lt;ExpandableListView android:id="@+id/android:list"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_weight="1"
              android:scrollbars="horizontal"
              android:layout_below="@id/top_bar"
              android:layout_marginBottom="45px"
              android:divider="#00000000"
              android:cacheColorHint="#00000000"
              android:listSelector="@layout/im_selector"
              android:focusable="true"              
            /&gt;
</code></pre>
