For Honeycomb, I have set my listview items to use the ?android:attr/activatedBackgroundIndicator style so they remain highlighted when selected.
How do I change the colour of the highlight?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Define a custom theme with the item:
Next, declare that drawable in a state list .xml file under
res/drawable/my_background.xmlas illustrated here: http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList Make sure that it has an item that responds toandroid:state_activated="true". This is your activated highlight.The theme step is optional, (you could use the state list drawable directly if you choose,) but it gives an added layer of flexibility and since you’ve already defined your ListView items to use that theme attribute you can make this change in one place to affect any Activity that uses the custom theme.
If you need more info on themes look here: http://developer.android.com/guide/topics/ui/themes.html