There are two types of menus:
- Contextual Menu: You see it press on the screen and hold it for a while
- Option Menu: You see it when you press on the "Menu" button.
Once the menu is created, the java code should handle the actions. No matter which method is used to draw the menus, the methods to capture and assign the behaviour of the menu are the same.
Personally I found the second method more clear. It separates the handler part of the display part.
Since I found good tutorial about it, I won't write too much.
DroidNova: http://www.droidnova.com/how-to-create-an-option-menu,427.html (Easy and simple. XML way)
DeveloperLife: http://developerlife.com/tutorials/?p=304 (Complete but complicated, Java way)
For more information:
Official Developer guide: http://developer.android.com/reference/android/view/Menu.html
Official Developer design guidelines: http://developer.android.com/guide/practices/ui_guidelines/menu_design.html