I have typical login screen. I was able to use imeOptions to allow user "tab" from one field to another and on last field(password) I have actionDone - it just closes soft keyboard. Ideally, I like to click "Login" automatically. Is there anything built-in for that?
Add imeOptions to your password EditText and define the action programmatically.
XML:
<EditText
android:id="@+id/passordEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Enter password"
android:inputType="textPassword"
android:imeOptions="actionSend"/>
Java:
EditText passwordET= v.findViewById(R.id.passwordEditText);
passwordET.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
boolean mHandled = false;
if (actionId == EditorInfo.IME_ACTION_SEND) {
onClick(yourLogInMethod);
mHandled = true;
}
return mHandled;
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With