0

let me make it simple to explain by images. i have a navigationview which contains a default menu, similar to this.

default menu in navigation view

if i click an item, it should open another menu in the drawer itself.

This is the Menu after selecting an item

I have doing some R&D since past few days but unable to get any idea. as i want to do it myself, i just want some hint to do this.

Thank you in advance.

  • 1
    you should use [**Expandable listview**](https://www.google.co.in/search?client=ubuntu&hs=53U&channel=fs&dcr=0&q=Expandable+listview+github&oq=Expandable+listview+github&gs_l=psy-ab.3..0i10k1j0i22i10i30k1.4760.6623.0.7086.7.7.0.0.0.0.201.1085.0j5j1.6.0....0...1.1.64.psy-ab..1.6.1080...0.J55HyhqjIU8) for this – AskNilesh Sep 14 '17 at 11:35
  • i want to navigate from a menu to another menu in the drawer itself. – Arpit todewale Sep 14 '17 at 11:36
  • follow this https://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/ – Ankita Sep 14 '17 at 11:37
  • check this [**Expandable navigation drawer**](https://www.google.co.in/search?client=ubuntu&channel=fs&q=expandble+navigation+drawr+android&ie=utf-8&oe=utf-8&gfe_rd=cr&dcr=0&ei=amq6WdXHBbPy8AfBy5qADg) – AskNilesh Sep 14 '17 at 11:40

1 Answers1

1

You should use the fragment to achieve this

Replace the FrameLayout with your fragment on the click of your item

<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">

    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>


    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:background="@color/white"
        android:orientation="vertical">

        <FrameLayout
            android:id="@+id/frmContainer"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </FrameLayout>

    </LinearLayout>

</android.support.v4.widget.DrawerLayout>
ibhavikmakwana
  • 8,948
  • 4
  • 20
  • 39