Q:

Navigation drawer is displaying under the views in my activity

Am trying to implement right navigation drawer.  the navigation bar will open when menu item is clicked in bottom navigation menu.  And everything is working fine.  but navigation drawer is opening under the widgets of main activity.  Can anyone please help this is my code. 
activity_main.xml
<? xml version="1.0" encoding="utf-8"? >
<androidx.constraintlayout.widget. ConstraintLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=". MainActivity">

    <Button
        android:id="@+id/button"
        android:layout_width="176dp"
        android:layout_height="66dp"
        android:text="Show maps"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.497"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.499" />

    <com.google.android.material.bottomnavigation. BottomNavigationView
        android:id="@+id/bottom_navi"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="#fff"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="1.0"
        app:menu="@menu/bottom_navigation"/>

    <androidx.drawerlayout.widget. DrawerLayout
        android:id="@+id/drawerlayout"
        android:layout_width="270dp"
        android:layout_height="match_parent"
        app:layout_constraintBottom_toBottomOf="@+id/bottom_navi"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="1.0"
        app:layout_constraintStart_toStartOf="@+id/button"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.0">

        <com.google.android.material.navigation. NavigationView
            android:id="@+id/sidenavi"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="end"
            android:fitsSystemWindows="true"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="1.0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.022"
            app:menu="@menu/bottom_navigation" />
    </androidx.drawerlayout.widget. DrawerLayout>

</androidx.constraintlayout.widget. ConstraintLayout>

MainActivity.kt
 @RequiresApi(Build. VERSION_CODES.M)
    override fun onCreate(savedInstanceState: Bundle?) { 
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        button = findViewById<Button>(R.id.button)
        button.setOnClickListener{
           OpenMap()
       }

        val bottomNavigation : BottomNavigationView = findViewById(R.id.bottom_navi)
        bottomNavigation.setOnNavigationItemSelectedListener (mOnNavigationItemSelectedListener)

        var navigationView : NavigationView = findViewById(R.id.sidenavi) as NavigationView
        navigationView.setNavigationItemSelectedListener (this)

    }
    @RequiresApi(Build. VERSION_CODES.M)
    fun OpenMap() {
         val intent = Intent(this, MapsActivity::class.java)
                startActivity(intent)
    }

    private  val mOnNavigationItemSelectedListener = BottomNavigationView. OnNavigationItemSelectedListener { item ->
        when (item.itemId){
            R.id.faq-> {

                return@OnNavigationItemSelectedListener true
            }
            R.id.membership -> {

                return@OnNavigationItemSelectedListener true
            }
            R.id.preview -> {

                return@OnNavigationItemSelectedListener true
            }
            R.id.about -> {

                return@OnNavigationItemSelectedListener true
            }
            R.id.menu-> {
                var drawer : DrawerLayout = findViewById(R.id.drawerlayout) as DrawerLayout
                if(drawer.isDrawerOpen(GravityCompat. END)){
                    drawer.closeDrawer(GravityCompat. END)
                }else{
                    drawer.openDrawer(GravityCompat. END)
                }
            }
        }
        false
    }

    override fun onNavigationItemSelected(item: MenuItem): Boolean {
        return true
    }

}

A:

Make your root layout as 
androidx.drawerlayout.widget. DrawerLayout

it will solve your problem
<? 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/drawerlayout"
    android:layout_width="270dp"
    android:layout_height="match_parent"
    tools:context=". MainActivity">

<androidx.constraintlayout.widget. ConstraintLayout
     android:layout_width="match_parent"
    android:layout_height="match_parent">

    <Button
        android:id="@+id/button"
        android:layout_width="176dp"
        android:layout_height="66dp"
        android:text="Show maps"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.497"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.499" />

    <com.google.android.material.bottomnavigation. BottomNavigationView
        android:id="@+id/bottom_navi"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="#fff"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="1.0"
        app:menu="@menu/bottom_navigation"/>

</androidx.constraintlayout.widget. ConstraintLayout>

<com.google.android.material.navigation. NavigationView
            android:id="@+id/sidenavi"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="end"
            android:fitsSystemWindows="true"
            app:menu="@menu/bottom_navigation" />

</androidx.drawerlayout.widget. DrawerLayout>

