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 Guy
www.curious-creature.org

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to