on my keyboard, hitting the ESC key = android's home button, which - i understand - cannot be trapped. at least not easily, from what i've read. i've tried with inline hooks (_oncreate, _onkeydown, onkeyup), and dispatchkeyevent. key touches on the physical keyboard using these methods register fine except when i hit esc: right to user close(false) with no indication of the keycode or scancode was when i touch esc. in other words, even though there is a KeyEvent.KEYCODE_ESCAPE, code in onkeyup or onkeydown never gets a chance to evaluate which key was touched. app is closed.
i'm led to understand that you have to setcontentview() and pass the view (presumably an edittext), but setconteview is already run when the app launches. whether or not successfully using setcontentview() to the edittext (instead of the layout) has any effect on trapping the esc key i don't know.