views:

28

answers:

1

Is there any way out for mapping the Done button to the button on the screen in Android. What I want is that I have one login screen user enters username and presses the next button on the soft keyboard which brings the focus on password field. AFter entering password when the user presses done button then the action which is performed on login button should be called.

Let me know if this is possible.

A: 

In your layout file, you can specify the focus order using attributes like nextFocusDown. If you have the focus order configured properly, hitting next should automatically take you to the next focusable element.

You can also add a KeyListener to the edit text to listen for the next key and set the focus accordingly.

Mayra