title: Android Options menu shows up but is empty
body: <p>I'm developing an Android app from &quot;Navigation Drawer Activity&quot; Template.</p>
  <p>When I click on the Options menu, it shows an empty menu when it should show the <code>Settings</code> item.</p>
  <p>I guess it could be because of the text color but I checked and for me it is not that.</p>
  <p>Where is my error?</p>
  <p><code>activity_main.xml</code>:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &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_layout&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:fitsSystemWindows=&quot;true&quot;
      tools:openDrawer=&quot;start&quot;&gt;
  
      &lt;include
          layout=&quot;@layout/app_bar_main&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot; /&gt;
  
      &lt;com.google.android.material.navigation.NavigationView
          android:id=&quot;@+id/nav_view&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;match_parent&quot;
          android:layout_gravity=&quot;start&quot;
          android:fitsSystemWindows=&quot;true&quot;
          app:headerLayout=&quot;@layout/nav_header_main&quot;
          app:menu=&quot;@menu/activity_main_drawer&quot; /&gt;
  &lt;/androidx.drawerlayout.widget.DrawerLayout&gt;
  </code></pre>
  <p><code>app_bar_main.xml</code>:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      tools:context=&quot;.MainActivity&quot;&gt;
  
      &lt;com.google.android.material.appbar.AppBarLayout
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:theme=&quot;@style/Theme.BodetTag.AppBarOverlay&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;
              android:minHeight=&quot;?attr/actionBarSize&quot;
              &gt;
  
              &lt;LinearLayout
                  android:layout_width=&quot;match_parent&quot;
                  android:layout_height=&quot;wrap_content&quot;
                  android:gravity=&quot;center_vertical&quot;
                  android:orientation=&quot;horizontal&quot;&gt;
  
                  &lt;ImageView
                      android:layout_width=&quot;50dp&quot;
                      android:layout_height=&quot;50dp&quot;
                      android:src=&quot;@drawable/bodet_icon_mini&quot; /&gt;
  
                  &lt;TextView
                      android:id=&quot;@+id/title&quot;
                      android:layout_width=&quot;wrap_content&quot;
                      android:layout_height=&quot;wrap_content&quot;
                      android:gravity=&quot;center&quot;
                      android:minHeight=&quot;?actionBarSize&quot;
                      android:padding=&quot;@dimen/appbar_padding&quot;
                      android:text=&quot;@string/app_name&quot;
                      android:textAppearance=&quot;@style/TextAppearance.Widget.AppCompat.Toolbar.Title&quot; /&gt;
  
              &lt;/LinearLayout&gt;
          &lt;/androidx.appcompat.widget.Toolbar&gt;
  
          &lt;com.google.android.material.tabs.TabLayout
              android:id=&quot;@+id/tabs&quot;
              android:layout_width=&quot;match_parent&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:background=&quot;?attr/colorPrimary&quot;
              app:tabSelectedTextColor=&quot;@color/white&quot;
              app:tabIndicatorColor=&quot;@color/white&quot;
              android:minHeight=&quot;?attr/actionBarSize&quot; /&gt;
  
      &lt;/com.google.android.material.appbar.AppBarLayout&gt;
  
      &lt;include layout=&quot;@layout/content_main&quot; /&gt;
  
      &lt;androidx.viewpager.widget.ViewPager
          android:id=&quot;@+id/view_pager&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          app:layout_behavior=&quot;@string/appbar_scrolling_view_behavior&quot; /&gt;
  
  &lt;/androidx.coordinatorlayout.widget.CoordinatorLayout&gt;
  </code></pre>
  <p><code>main.xml</code>:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;&gt;
      &lt;item
          android:id=&quot;@+id/action_settings&quot;
          android:orderInCategory=&quot;100&quot;
          android:title=&quot;@string/action_settings&quot;
          app:showAsAction=&quot;never&quot; /&gt;
  &lt;/menu&gt;
  </code></pre>
  <p><code>MainActivity.kt</code>:</p>
  <pre><code>package com.example.bodettag
  
  import android.os.Bundle
  import android.view.Menu
  import com.google.android.material.floatingactionbutton.FloatingActionButton
  import com.google.android.material.snackbar.Snackbar
  import com.google.android.material.navigation.NavigationView
  import androidx.navigation.findNavController
  import androidx.navigation.ui.AppBarConfiguration
  import androidx.navigation.ui.navigateUp
  import androidx.navigation.ui.setupActionBarWithNavController
  import androidx.navigation.ui.setupWithNavController
  import androidx.drawerlayout.widget.DrawerLayout
  import androidx.appcompat.app.AppCompatActivity
  import androidx.appcompat.widget.Toolbar
  import androidx.viewpager.widget.ViewPager
  import com.example.bodettag.ui.page.SectionsPagerAdapter
  import com.google.android.material.tabs.TabLayout
  
  class MainActivity : AppCompatActivity() {
  
      private lateinit var appBarConfiguration: AppBarConfiguration
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
          val toolbar: Toolbar = findViewById(R.id.toolbar)
          setSupportActionBar(toolbar)
  
          val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout)
          val navView: NavigationView = findViewById(R.id.nav_view)
          val navController = findNavController(R.id.nav_host_fragment)
          // Passing each menu ID as a set of Ids because each
          // menu should be considered as top level destinations.
          appBarConfiguration = AppBarConfiguration(setOf(
                  R.id.nav_home, R.id.nav_gallery, R.id.nav_slideshow), drawerLayout)
          setupActionBarWithNavController(navController, appBarConfiguration)
          navView.setupWithNavController(navController)
  
          val sectionsPagerAdapter = SectionsPagerAdapter(this, supportFragmentManager)
          val viewPager: ViewPager = findViewById(R.id.view_pager)
          viewPager.adapter = sectionsPagerAdapter
          val tabs: TabLayout = findViewById(R.id.tabs)
          tabs.setupWithViewPager(viewPager)
      }
  
      override fun onCreateOptionsMenu(menu: Menu): Boolean {
          // Inflate the menu; this adds items to the action bar if it is present.
          menuInflater.inflate(R.menu.main, menu)
          return true
      }
  
      override fun onSupportNavigateUp(): Boolean {
          val navController = findNavController(R.id.nav_host_fragment)
          return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
      }
  }
  </code></pre>
  <p>Please let me know if you see any possible improvements to my code, whether they are related to my problem or not.</p>
  <p>Thanks for your help!</p>
  <p><strong>EDIT:</strong> What I want vs what I get</p>
  <p><a href="https://i.stack.imgur.com/IhV6z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IhV6z.png" alt="enter image description here" /></a><a href="https://i.stack.imgur.com/tiTzmm.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tiTzmm.jpg" alt="enter image description here" /></a></p>