I have made a layout in which I have created a toolbar of my own in XML and I have set the Navigation View according to my requirement. I want that after clicking the hamburger icon the topleft , navigationView content should be displayed along with the back button on the topleft. I am able to make the content in the navigation View Visible but not the back button. Because the Navigation View is overlapping on my toolbar and the back button gets behind or underneath the navigation view. I am not getting the way to sort this out in XML. help me in this situation.
Code for the XML layout is given below:
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="start"
android:id="@+id/dl"
android:orientation="vertical"
tools:context="com.example.loveb.demo_viewpager.MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:id="@+id/toolbar"
>
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/toolbar"
android:id="@+id/tablayout"
android:background="@color/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
</android.support.design.widget.TabLayout>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/tablayout"
android:id="@+id/pager">
</android.support.v4.view.ViewPager>
</RelativeLayout>
<android.support.design.widget.NavigationView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:id="@+id/navview"
app:headerLayout="@layout/drawer_layout"
app:menu="@menu/menu"
>
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>