Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Sub Menu in android

Tags:

android

I want to create a Sub Menu in existing Menu Item in Android.

How I can achieve it ?

Thanks.

like image 703
Kartik Bhatt Avatar asked Jun 30 '11 06:06

Kartik Bhatt


1 Answers

It's as simple as placing a menu inside an item.

For example:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/file"
          android:icon="@drawable/file"
          android:title="@string/file" >
        <!-- "file" submenu -->
        <menu>
            <item android:id="@+id/create_new"
                  android:title="@string/create_new" />
            <item android:id="@+id/open"
                  android:title="@string/open" />
        </menu>
    </item>
</menu>

From Creating Menus | Android Developers

like image 70
jsw Avatar answered Sep 28 '22 06:09

jsw