title: How to Improve the way to Hide/Show NavigationView menu Items?
body: <p>I was wondering how can I Improve the way that I'm handling menu item access in my app.</p>
  
  <p>First of all I've a Login Activity where the users logs in and if succes it retrieves a list of all the menu items he can have access.</p>
  
  <p>Then in every activity I need to run the method to hide the menu items that the user have not access.</p>
  
  <p>Its called <code>setMenus</code> and the List <code>listaMenuMuestra</code> is the list obtained in the Login Activity</p>
  
  <pre><code>public void setMenus(List&lt;ListaMenu&gt; listaMenuMuestra){
          NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
          Menu nav_menu = navigationView.getMenu();
          for(int i = 0; i &lt; listaMenuMuestra.size(); i++){
              try{
                  int idMenu = getResources().getIdentifier(listaMenuMuestra.get(i).getIdMenu(), "id", getPackageName());
                  nav_menu.findItem(idMenu).setVisible(true);
              }catch (Exception ex){
                  Log.d("error","error");
              }
          }
  </code></pre>
  
  <p>Here's my <code>activity_main_drawer.xml</code>. By default all the items are invisible.</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      tools:showIn="navigation_view"&gt;
  
      &lt;group android:checkableBehavior="single"&gt;
          &lt;item
              android:id="@+id/nav_inicio"
              android:icon="@drawable/ic_menu_home"
              android:title="Inicio"
              android:visible="false"/&gt;
  
          &lt;item
              android:id="@+id/nav_ultimas"
              android:icon="@drawable/ic_menu_send"
              android:title="Últimas consultas"
              android:visible="false"/&gt;
  
      &lt;/group&gt;
      &lt;item android:title="Estadísticas"
          android:id="@+id/nav_tituloestadisticas"
          android:icon="@drawable/ic_insert_chart"&gt;
          &lt;menu&gt;
              &lt;item
                  android:id="@+id/nav_torta"
                  android:icon="@drawable/ic_pie_chart"
                  android:title="Gráfico de torta"
                  android:visible="false"/&gt;
              &lt;item
                  android:id="@+id/nav_lineal"
                  android:icon="@drawable/ic_show_chart"
                  android:title="Análisis por fechas"
                  android:visible="false"/&gt;
          &lt;/menu&gt;
      &lt;/item&gt;
  
  
  &lt;/menu&gt;
  </code></pre>
  
  <p>The "problem" that Im facing is that I've plenty Activities and it seems pretty odd to me to have to run <code>setMenus</code> on each Activity.</p>
  
  <p>So the questions are <strong>Is there a better way to handle menu items access with multiple activies and NavigationDrawer? Can just <code>setMenus</code> be called only once and keep these changes across all activities?</strong></p>