OK, thanks, now I see why the listview element is selected/highlighted some times (but not at other times)
Btw I didn't exactly touch the screen before the listview showed up. However, I had used the mouse to click "Next" on the previous screen and that brought up the next activity. I guess using the mouse leaves a lingering touch for the next screen Instead, if I use the emulator arrow keys (and <ENTER> on the keyboard) to select "Next", the next page comes up with the listview element selected/highlighted as appropriate. A real device obviously won't use a mouse. However, for ADC challenge purposes, I'll need to a note to the judges telling them that if they use the mouse for navigation, their listbox entries may not show up as highlighted/selected On Apr 13, 1:57 pm, "Romain Guy" <[EMAIL PROTECTED]> wrote: > This happens when you touch the screen before the ListView shows up. > You are then in touch mode and selection and focus do not exist in > touch mode. > > Note that you should not call setSelected(true) on the ListView. > > > > > > On Sun, Apr 13, 2008 at 1:21 PM, Ram <[EMAIL PROTECTED]> wrote: > > > Hi, a couple of my pages have listViews in them. > > > I've used the following code to set selection within the listview > > > m_list.requestFocus(); > > m_list.setSelected(true); > > m_list.setSelection(0); > > and I've also tried m_list.setSelectionAfterHeaderView(); > > > Sometimes when the page is first launched, the first element of the > > listview is highlighted ..and I can scroll down the list. > > > Some other times, however, no listview element is highlighted. > > Pressing the down arrow selects the first listview element. > > > Is there anyway for my code to ensure that the first listview element > > is always highlighted/selected when the contentView is first displayed > > by the activity ? > > -- > Romain Guywww.curious-creature.org- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

