I\'ve used some apps where when I fill my username, then go to my password, if I hit \"Done\" on the keyboard, the login form is automatically submitted, without me having t
You need to set the IME Options on your EditText
.
Then add a OnEditorActionListener
to the view to listen for the "done" action.
EditText editText = (EditText) findViewById(R.id.some_view);
editText.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
boolean handled = false;
if (actionId == EditorInfo.IME_ACTION_DONE) {
// TODO do something
handled = true;
}
return handled;
}
});
Official API doc: https://developer.android.com/guide/topics/ui/controls/text.html#ActionEvent