I'm wondering which KeyEvent action is called when a user presses the little upside-down triangle in nexus phone when soft keyboard is open.
In normal mode Nexus looks like this and the normal code works fine: Nexus without keyboard
But when keyboard pops up it looks like this and the code won't work:
For android API up to 5:
For android before API 5 you must use this:
Please refer to How to handle back button in activity
EDIT:
This methods works only if the keyboard is hidden..
according with this answer: Detect back key press - When keyboard is open
The best action to be implement is dispatchKeyEventPreIme. An example is:
Where mActivity is your activity class (this).