I\'m trying to override the functionality of the back key press. When the user presses it once, I want it to come back to the previous screen. However, when the back key is
Why not use onKeyUp() as well as onKeyDown()? During onKeyDown() you do not know whether it is a long press or not, because that is called as soon as the key is pressed and you do not know how long the user intends to hold the key down for. As KasperMoerch correctly says, you need to call startTracking in your onKeyDown() method, and return true. Then in your onKeyUp() you can call event.isTracking() and event.isLongPress() to determine whether to handle things as a long press or short press.