开发者

How to map Soft Keyboard button to button on screen in Android?

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 开发者_如何学JAVAon login button should be called.

Let me know if this is possible.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜