Reputation: 1962
Is there a way to know when the user hits the ok key on the keyboard?
Upvotes: 1
Views: 866
Reputation: 1006819
Call setOnEditorActionListener()
on your EditText
, and your OnEditorActionListener
will be called with onEditorAction()
when the user presses the IME action key.
Note that not all IMEs have such a key, so do not count on this.
Upvotes: 3
Reputation: 7585
Try KeyEvent.FLAG_EDITOR_ACTION
From: http://developer.android.com/reference/android/view/KeyEvent.html#FLAG_EDITOR_ACTION
Upvotes: 0