I have an Edit Text that is defined as follows.
Take a look at the setImeActionLabel method (or imeActionLabel and imeActionId attributes) and setOnEditorActionListener to set a listener to respond to the events.
imeActionLabel
imeActionId