You don't need to use your own timers. You can use the getDownTime
and getEventTime
methods of the event
parameter when receiving the KeyEvent.ACTION_UP
action.
Also, The nested <action android:name="android.intent.action.MEDIA_BUTTON"/>
in your manifest is not required