How to add listener on "Enter" button in the virtual keyboard?

Viewed 29

Instead of hiding keyboard I would like to tight an action listener to the Enter button. To my understanding, it might have different behavior on iOS and Android, as well as it might be not very reliable.

I will appreciate any suggestions.

1 Answers

You can use setDoneListener on text components e.g.:

myTextField.setDoneListener(e -> doSomething());
Related