views:

17

answers:

1

Hi,

My activity has a set of buttons on the left half of the screen and a ListView on the right. Initially the focus is on the first button. When I browse the buttons by pressing DOWN arrow key and then press the RIGHT arrow key, the focus does not go to the topmost list item. Instead, the list item correspondingly on the right gets focused.

Is there a way that when I press the RIGHT arrow key, the focus goes to the topmost item on the Listview?

Any inputs would be appreciated!

Regards, kiki

A: 

once again, I'm answering my own question.

To get the focus to go to the top of the ListView, do the following:

myList.setSelection(0);
myList.requestFocus(0);

0 being position of the topmost item on the list view.

Hope this helps somebody!

kiki