I am trying to get a login screen for an Android app and so far this is my code:
You should set OnEditorActionListener for the EditText to implement the action you want to perform when user clicks the "Done" in keyboard.
Thus, you need to write some code like:
password.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
// Do whatever you want here
return true;
}
return false;
}
});
See the tutorial at android developer site