After creating an Android Project in Eclipse called “AndroidMenus” I then set about creating a new XML file in a folder (you need to create this folder) called “menu” under the “res” (parent) folder. I named the xml file “mymenu.xml” and added this:

As you can see we need to make sure we have some icons for the menu as well as some menu item strings in the strings.xml file which is located in the “res/values” folder. Here is my modified strings.xml file:

Hello World, AndroidMenus!Android MenusItem 1Item 2

The “main.xml” file can be left just as the project wizard created it however you need to modify the “AndroidMenus.java” file to override the onCreateOptionsMenu method.

You also need to create some icons and place them into the appropriate folders as seen below:

Once you’ve got this done you can run the project. In the emulator press the “Menu” button to trigger the menu.

Results:

Yes its pretty ugly but like I said I’m not a graphics person. If you click on the menu items nothing happens, lets change this now by adding some Java code to the “AndroidMenus.java” file. For this we need to override the onOptionsItemSelected method.