Answer the question
In order to leave comments, you need to log in
How to catch back key press in EditText?
I work with EditText. I understand how to catch the event when the Send button is clicked, but how to catch the Back key?
I tried different options, but it turned out to be solved only by redoing the EditText in Custom View.
https://rmcreative.ru/blog/post/android-poymat-bac...
Are there easier ways to solve this problem?
Answer the question
In order to leave comments, you need to log in
Option 1: Add an onKeyListener handler for the EditText.
Option 2: Add an onBackPressed handler to the Fragment/Activity.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question