I want to make a collapsible sub-menu in my navigation drawer.
I started with a Navigation Drawer Activity sample.
My activity_main_drawer.xml:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="navigation_view">
<item
android:id="@+id/group2"
android:title="categoryhere">
<menu>
<item
android:title="title" >
<menu>
<item
android:title="item2" />
<item
android:title="item3" />
</menu>
</item>
</menu>
</item>
</menu>
This code is not working.
I saw that I should use the ExpandableListView but I really don't know how and all posts doesn't explain it.
Please note that this post is not a duplicate of this post, this post or this one.
Thanks in advance.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…