0

neither nesting nor movement of menuItems and groups up and down wrt each other is taking place. Android Studio version - 2.3.1 enter image description here

1 Answer 1

0

here is the code you can use,

<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.akshaymanagooli.adggbtbrt.MainActivity">
<item
    android:id="@+id/action_settings"
    android:orderInCategory="100"
    android:title="settings"
    app:showAsAction="never" />
<item
    android:id="@+id/item"
    android:orderInCategory="100"
    android:title="items"
    app:showAsAction="never" >
    <menu>
        <item
        android:id="@+id/item1"
        android:orderInCategory="100"
        android:title="item 1"
        app:showAsAction="never" />
        <item
            android:id="@+id/item2"
            android:orderInCategory="100"
            android:title="item 2"
            app:showAsAction="never" />
    </menu>
</item>
</menu>

So idea is inside an item create a new menu block and add your sub items in there so it'll show you a arrow mark like dropdown thing.

5
  • just open the text tab and you can do these changes. Commented Apr 18, 2017 at 13:23
  • Why it is not possible through component tree, without using xml? I am new to android development .
    – Vipin
    Commented Apr 18, 2017 at 13:27
  • I am also still learning but , dont get addicted to drag and drop, best way is to do in text coz you will have more control Commented Apr 18, 2017 at 13:33
  • Okay ! Thanks Man ! When did you start android development?
    – Vipin
    Commented Apr 18, 2017 at 15:19
  • about 3 months ago Commented Apr 19, 2017 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.