Syntax

The file must have a single root element: a <menu> element. In all, there are three valid elements: <menu>, <group> and <item>. The <item> and <group> elements must be the children of a <menu>, but <item> elements can also be the children of a <group>, and another <menu> element may be the child of an <item> (to create a Sub Menu).

<menu xmlns:android="http://schemas.android.com/apk/res/android">

<item android:id="@+id/example_item android:title="Example Item"

android:icon="@drawable/example_item_icon" />

<group android:id="@+id/example_group"> <item android:id="@+id/example_item2 android:title="Example Item 2"

android:icon="@drawable/example item2 icon" />

<item android:id="@+id/example_submenu android:title="Example Sub Menu" > <menu>

<item android:id="@+id/example_submenu_item android:title="Example Sub Menu Item" />

0 0

Post a comment