Home » Phonegap » Create Android Native Menu in Phonegap

Create Android Native Menu in Phonegap

Here is the step to create native android menu in phonegap.

Step 1 : Add the code in your activity class file

It looks like as follows

Step 2 : Now create an activity_main.xml file in “res/menu/” folder

Add the following code in it.

Step 3 : Now define the strings in the strings.xml file at “res/values/” location

Step 4 : Also define the ids and string in R.java file at “gen/com.example.testapp/”, normally the ids and all other variables will be automatically added to R.java file, so you only needed to add it manually if shows error.

Step 5: Now add code in your main activity so that the menu action to be done when clicking them.

Now it looks like this

Now it works !!!

About the author


Hi, i am Vipin, a programmer working in Dubai, UAE. I love blogging, and so started TechRounder for sharing my findings and other digital informations with others too. Please feel free to share your feedback with me in the comment section below or you can email me at vipin@techrounder.com.

Add Comment

Click here to post a comment

Your email address will not be published. Required fields are marked *

Get latest updates
in your inbox

Subscribe to TechRounder mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.