Wow, documentation is horrible when it comes to list item selection. All I need is to be able to select and highlight multiple items in a list. I've scoured the web and seen references to android:choiceMode="multipleChoice"
, which I'm guessing allows you to select multiple items. But where can I get the selected items in my Activity? And how come when I try to select multiple items using setSelection(position)
, the previously highlighted item disappears?
Google also describes in View.setActivated(boolean)
that
Note that activation is not the same as selection. Selection is a transient property, representing the view (hierarchy) the user is currently interacting with. Activation is a longer-term state that the user can move views in and out of. For example, in a list view with single or multiple selection enabled, the views in the current selection set are activated. (Um, yeah, we are deeply sorry about the terminology here.)
So am I supposed to use activation instead of selection? This SO answer talks about how "activated" is just the post-HoneyComb version of "checked". But if you're supposed to use "activated" for multiple selection, whats the point of android:choiceMode="multipleChoice"
in the first place?