如何在“导航抽屉”的默认菜单上单击“单击”中的另一个菜单



让我简单地通过图像解释。我有一个包含默认菜单的NavigationView,类似于此。

导航视图中的默认菜单

如果我单击一个项目,则应在抽屉本身中打开另一个菜单。

选择项目

之后,这是菜单

我从过去几天开始做一些R& d,但无法理解任何想法。就像我想自己做的那样,我只想提示这样做。

预先感谢您。

您应该使用片段实现此

单击您的物品

,用片段替换framelayout
<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>

最新更新