At first I made an Override of onBackPressed in the activity. I can catch the back button pressed event correctly with this method. Later, to detect the press down and release action of the volume button, I implemented the onKeyDown and onKeyUp method. Then I found no matter I returned true or false from the onKeyDown and onKeyUp, the onBackPressed method never got fired. Does anyone know how to make onBackPressed and onKeyDown,OnkeyUp all to be called consequently?Any help is much appreciated!
As I already said in the comments it is because you have forgotten to add the default: return super.dispatchKeyEvent(event);
in the dispatchKeyEvent method.
For better clarification just look at this example of dispatchKeyEvent