Wednesday, 26 August 2015

android inputbox edittext focus. nextFocusUp, nextFocusLeft, nextFocusRight ,nextFocusDown

nextFocusUp, nextFocusLeft, nextFocusRight ,nextFocusDown   are designed for old phone. when you use hardware keyboard to navigate UI focus. (left, right, up and down are keyboard keys, they are not relative layout things)

nextFocusUp -- for up key
nextFocusLeft -- for left key
nextFocusRight -- for right key
nextFocusDown -- for down key

for new phones which do not have hardware keyboard.

we should set:

nextFocusUp  and nextFocusLeft to the same component id.

nextFocusRight and nextFocusDown to the same compnent id

Then, it will control the next focused component when you type "next" in your keyboard.

No comments:

Post a comment