• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps The virtual keyboard and the Next button

D

Deleted User

Guest
As you undoubtably know by now, I'm writing a little messaging app.

My first Activity is a login screen. It's simple and straight forward. Theres a username textbox, a password textbox and a login button.

When the user "clicks" the username textbox, the virtual keyboard pops up. Once they've typed their name, they can click the Next button on the virtual keyboard. The password textbox gains focus and the virtual keyboard remains. The user can type their password and then click the Done (text was changed from "Next" to "Done") button again.

This is where my problem lies.

The screen moves up as to show the login button above the virtual keyboard, but the virtual keyboard remains. When the user clicks the Done button when the password textbox has focus, I want the password textbox to lose focus and the virtual keyboard to disappear.

How can I achieve this?
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones