I found nice tutorial that teach how to add both Left and Right Navigation Drawers in Android App.
https://updateunlimited.blogspot.com/2015/12/double-sided-nav-drawers.html
Everything works in empty project with just one main activity. But I want to use this solution in second activity. I have created file activity_right_drawer.xml in menu directory. I have added second NavigationView in second_activity.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
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"
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_kategorie"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
android:background="#2A3E6B"
app:itemTextColor="#eee"
app:itemIconTint="#eee"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
<android.support.design.widget.NavigationView
android:id="@+id/nav_right_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="end"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_right_drawer" />
</android.support.v4.widget.DrawerLayout>
But the problem raise with file main.xml Tutorial says to add item into main.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_openRight"
android:orderInCategory="100"
android:title="@string/action_settings"
android:icon="@drawable/ic_open_right"
app:showAsAction="always" />
</menu>
This file is only for MainActivity
not for secondActivity.
How can I create file like main.xml for secondActivity
and tell me that second_main.xml is file for secondActivity
Adding FrameLayout like Two Navigation Drawer on same Activity doesnt help, otherwise i need to use NavigationView not ListView