0

I am trying to use the Listview to display some data. I need to keep the focus on the top item in the list and when I capture a Keypress I want the list data to scroll with with the focus remaining on the top item. Is this possible?

Allan Muller
  • 308
  • 1
  • 5
  • You can use setItemChecked(position, boolean) to keep the position as selected. Have u tried this? – Kanak Sony Feb 05 '14 at 16:44
  • You will need to call setChoiceModel(int mode) on your list and call setItemChecked(position, boolean) to keep the position as selected. Have u tried this? But when you will scroll. Now the item is selected but you might see nothing change because there's no visual feedback of the selection. Is your listview predefined or custom? – Kanak Sony Feb 05 '14 at 16:51

1 Answers1

0

No, when you scroll a list, its create the elements at runtime.

So, if you have a list with 20 elements, and the list is scrolled showing only the elements between 10-15, it's like the first element doesn't exist.

Giacomoni
  • 1,468
  • 13
  • 18