In my application I have only one activity and I am using ViewAnimator for changing the screen. For the Menu and Back Keys I am trying to pause the activity (like home key does) and show a menu or go back to previous View.
Angry Birds do the same think (Angry Birds Rio do exactly the same thing what I want).
I have also checked the OnKeyDown event to find out how the Home key work but I think it is handled by the system.
Thanks.
In order to catch the menu key:
Read more here: http://developer.android.com/reference/android/app/Activity.html#onCreateOptionsMenu(android.view.Menu)
Ir order to catch the back key event:
Read more here: http://developer.android.com/reference/android/app/Activity.html#onKeyUp(int, android.view.KeyEvent)
EDIT:
Pausing your application’s logic is up to you. But you can show an
AlertDialogwith up to three buttons and/or any View you want: http://developer.android.com/reference/android/app/AlertDialog.html