Search Wikipedia

Search results

Showing posts with label Option menu. Show all posts
Showing posts with label Option menu. Show all posts

Oct 18, 2013

Option Menu in Android

Creating an option menu


There are different kinds of menu in android.
Today i am gonna  create a option menu.
There are couple of ways of creating option menu.
One  is directly by java code and another is using XML.

But in my case i will use XML because it provides good graphical interface and its easy to handle in compare to java. So i create a new XML file.

Creating a mymenu.xml


mymenu.xml


<?xml version="1.0" encoding="utf-8"?>

<menu xmlns:android="http://schemas.android.com/apk/res/android" >
    
    <item android:id="@+id/item1" 
        android:title="Option 1" 
        android:icon="@android:drawable/ic_menu_compass"/>
   
    <item android:id="@+id/item2 "
        android:title="Option 2" 
        android:icon="@android:drawable/ic_menu_call"/>
</menu>


mymenu.xml



}