In my App I have 7 buttons aligned using relative layout. The order I display the buttons are as below,
one Two
Three
Four Five
Five Six
In the above layout Two, Three, Five, Six are setClickable(false).
One, Four, Five are enabled.
Now when I press the down arrow key of keypad to navigate button “one” is getting focussed. Next if I press down arrow key again I want the button “Four” should be focussed instead of button Two.
Does Android got any property or method that can be used to give this navigation order? If not what is the best logic I can use to implement this?
(I am thinking the logic as,
1. Override the keyDown event
2. On down arrow key press event see the button "One" is focussed or not
--> if not set the focus to it
3. else check the button "Four" is focussed or not --> if not set the focus to it
so on…..
But it seems I am making the things complex…
)
Thanks
I used setNextFocus… methods for something like this before and it got the job done.
setNextFocusDown documentation