WoodManEXP wrote: > 1. When does OnItemSelectedListener get called? <snip>
> (It is called if the list has focus and I move through the > list with the arrow keys in the emulator) Is that the way it works? Yes. > 2. With a ListView set up this way who handles display of selected > list items? Does the ListView do it or should the adapter configure > the views it supplies to make them look “selected?” Um, it's complicated. Many widgets have different looks for "selected" versus not. This is usually part of the widget background, which is why you'll see a few recent posts on this list where people wondered why items no longer showed up as selected when they set the background of the item to some fixed color. The ListView is responsible for telling a row View "yo, dawg, you're selected" (or "not selected" as the case may be). The row itself is then responsible for actually making the UI change. For most people, the default behavior is fine. You also: -- can use a <selector> (StateListDrawable) to teach things to have different looks based on whether or not they are selected -- can override the selector in your layout XML -- can use OnItemSelectedListener to radically change the behavior These latter two techniques are written up in this old blog post o' mine: http://www.androidguys.com/2008/07/28/fancy-listviews-part-five/ (forgive the missing images -- AndroidGuys changed servers at least twice since I wrote it, and all the images got whacked as a result). Note that this is over a year old and was written for the M5 SDK from last summer, so there may need to be some code changes for the snippets involved. I have related material that I keep up to date for (*cough*) one of my books: http://github.com/commonsguy/cw-advandroid/tree/master/ListView/Selector At some point, I'll write up the <selector>/StateListDrawable approach as well. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Beginning Android_ from Apress Now Available! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---