All i need is an idea or path to continue searching, i have a list of items that i add to a listview adapter. And i am trying to make some items in the list to have a specific background color (as an example) when the activity loads. Something like having those rows "preselected". The method public ListView getListView()
does not help me much.
Thank you either way.
Asked
Active
Viewed 2,137 times
4

Gabriela Radu
- 757
- 2
- 12
- 33
-
Did this http://stackoverflow.com/questions/2217753/changing-background-color-of-listview-items-on-android helps you? – Manos Oct 18 '11 at 22:18
1 Answers
5
Need to set Multiple Choice Mode via setChoiceMode(), and then you can call setItemChecked() for each of the items you want checked. Then you probably have to make a custom adapter that overrides getView(), cast the parent to ListView and ask if the View (a list item) you are getting at the position given is in fact checked by calling something like getCheckedItems() on the parent. Then you can do what ever you want with that view, like set its background color etc.

MrJre
- 7,082
- 7
- 53
- 66