Im trying to use 3 menus and for that 3 drawer layouts, but only the one in the activity_main is working. do i need to have every drawer in the activity_main or im doing something wrong?
i tested every menu in the activity_main and every one is working fine but when i try in the activity_main_manager none works. im trying to call by id
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(R.layout.activity_main_admin)
setSupportActionBar(binding.appBarMain.toolbar)
val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout_admin)
my activiy_main:
`<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.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
android:id="@+id/app_bar_main"
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:itemIconTint="@color/my_yellow"
app:itemRippleColor="@color/my_yellow"
app:itemShapeFillColor="@color/my_blue"
app:itemTextColor="@color/my_yellow"
app:menu="@menu/activity_main_drawer" />
</androidx.drawerlayout.widget.DrawerLayout>`
activity_main_admin:
`<?xml version="1.0" encoding="utf-8"?>
<androidx.drawerlayout.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_admin"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
android:id="@+id/app_bar_main"
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:itemIconTint="@color/my_yellow"
app:itemRippleColor="@color/my_yellow"
app:itemShapeFillColor="@color/my_blue"
app:itemTextColor="@color/my_yellow"
app:menu="@menu/activity_main_drawer_admin2" />
</androidx.drawerlayout.widget.DrawerLayout>`