title: Hamburger icon not opening navigation drawer
body: <p>When i open my app and click on the hamburger icon, it is does not open the navigation drawer. But when i swipe from the edges it is opening. Also the drawer responds to hamburger icon click events after the swipe action.</p>
  <p>I tried every solution on stackoverflow but couldn't resolve the issue. Please someone help. Thanks in advance.</p>
  <p>XML Code:</p>
  <pre><code>&lt;androidx.drawerlayout.widget.DrawerLayout 
  xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
  xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;
  xmlns:tools=&quot;http://schemas.android.com/tools&quot;
  android:id=&quot;@+id/drawer&quot;
  android:layout_width=&quot;match_parent&quot;
  android:layout_height=&quot;match_parent&quot;
  tools:openDrawer=&quot;start&quot;
  tools:context=&quot;.MainActivity&quot;&gt;
  
  &lt;RelativeLayout
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:id=&quot;@+id/activity_main&quot;&gt;
  
      &lt;com.google.android.material.appbar.AppBarLayout
          android:id=&quot;@+id/appBarLayout&quot;
          android:layout_alignParentTop=&quot;true&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;&gt;
  
              &lt;androidx.appcompat.widget.Toolbar
                  android:id=&quot;@+id/toolbar&quot;
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  app:title=&quot;Nexzen&quot;
                  app:titleTextColor=&quot;@color/white&quot;
                  android:background=&quot;@color/dark_green&quot;/&gt;
  
      &lt;/com.google.android.material.appbar.AppBarLayout&gt;
  
      &lt;com.google.android.material.tabs.TabLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:id=&quot;@+id/tabLayout&quot;
          android:background=&quot;@color/dark_green&quot;
          app:tabTextColor=&quot;@color/white&quot;
          app:tabIndicator=&quot;@color/receive_message&quot;
          app:tabSelectedTextColor=&quot;@color/receive_message&quot;
          android:layout_below=&quot;@id/appBarLayout&quot;/&gt;
  
      &lt;androidx.viewpager2.widget.ViewPager2
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          android:id=&quot;@+id/viewPager&quot;
          android:layout_below=&quot;@id/tabLayout&quot;/&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;com.google.android.material.navigation.NavigationView
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;match_parent&quot;
      android:id=&quot;@+id/navmenu&quot;
      android:visibility=&quot;gone&quot;
      app:menu=&quot;@menu/drawer_menu&quot;
      app:itemTextColor=&quot;@color/text_color&quot;
      app:itemIconTint=&quot;@color/text_color&quot;
      app:headerLayout=&quot;@layout/nav_header&quot;
      android:layout_gravity = &quot;start&quot; /&gt;
  
  &lt;/androidx.drawerlayout.widget.DrawerLayout&gt;
  </code></pre>
  <p>Activity code :</p>
  <pre><code>@Override
          protected void onCreate(Bundle savedInstanceState) {
              super.onCreate(savedInstanceState);
              binding = ActivityMainBinding.inflate(getLayoutInflater());
              setContentView(binding.getRoot());
      
              setSupportActionBar(binding.toolbar);
      
              toggle = new ActionBarDrawerToggle(this, binding.drawer, binding.toolbar, R.string.open, R.string.close);
              toggle.getDrawerArrowDrawable().setColor(getColor(R.color.white));
              toggle.setDrawerIndicatorEnabled(true);
              toggle.setDrawerSlideAnimationEnabled(true);
              binding.drawer.addDrawerListener(toggle);
              toggle.syncState();
      
          }
      
      @Override
          protected void onStart() {
              super.onStart();
          }
      
          @Override
          public boolean onCreateOptionsMenu(Menu menu) {
              return super.onCreateOptionsMenu(menu);
          }
      
          @Override
          public boolean onOptionsItemSelected(@NonNull MenuItem item) {
              if (toggle.onOptionsItemSelected(item)) {
                  binding.drawer.openDrawer(GravityCompat.START);
                  return true;
              }
      
              return super.onOptionsItemSelected(item);
          }
      
          @Override
          protected void onPostCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
              super.onPostCreate(savedInstanceState);
              toggle.syncState();
          }
      
          @Override
          public void onBackPressed() {
              super.onBackPressed();
              finish();
          }
  </code></pre>