0

The list selection is not working in 2.2. I found many of them having this issue but i did not find a solution which is working.

 <selector xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:state_activated="false">
            <shape android:shape="rectangle">
              <solid android:color="@android:color/transparent" />
            </shape>
        </item>
        <item android:state_activated="false" android:state_pressed="false">
             <shape android:shape="rectangle">
                <solid android:color="@android:color/transparent" />
            </shape>
        </item>
        <item android:state_pressed="true">
            <shape android:shape="rectangle">
                 <solid android:color="@color/list_selector" />
            </shape>
        </item>
         <item android:state_selected="true">
            <shape android:shape="rectangle">
                 <solid android:color="@color/list_selector" />
            </shape>
        </item>
        <item android:state_activated="true">
             <shape android:shape="rectangle">
                 <solid android:color="@color/list_selector" />
            </shape>
        </item>
 </selector>

The above selector is my listselector. Its working fine in other devices 3.1, 4.1 etc..But its not working in 2.2

Any Help is appreciated.

user1702512
  • 95
  • 1
  • 6

1 Answers1

0

I think the problem lies in android:state_activated It was added in API 11(3.0), so it wont work in prior versions. More info in doc.

I believe you can accomplish the same behavior using state_checked property (available since API 1).

Also check this post.

Hope it helps.

Community
  • 1
  • 1
T.V.
  • 793
  • 12
  • 33