title: XAMARIN.android - get id item menu
body: <p>i'm new on xamarin, actually i'm working on android menu, but i have some problem to get the item ID and start activity for each item: </p>
  
  <p><strong>MainActivity.cs</strong></p>
  
  <pre><code>[Activity(Label = "sofis3", MainLauncher = true, Icon = "@mipmap/icon", Theme = "@style/Theme.DesignDemo")]
      public class MainActivity : AppCompatActivity
      {
  
          DrawerLayout drawerLayout;  
          NavigationView navigationView;  
  
          protected override void OnCreate(Bundle savedInstanceState)
          {
              base.OnCreate(savedInstanceState);
              SetContentView(Resource.Layout.Main);
  
              var toolbar = FindViewById&lt;V7Toolbar&gt;(Resource.Id.toolbar);
              SetSupportActionBar(toolbar);
              SupportActionBar.SetDisplayHomeAsUpEnabled(true);
              SupportActionBar.SetDisplayShowTitleEnabled(false);
              SupportActionBar.SetHomeButtonEnabled(true);
              SupportActionBar.SetHomeAsUpIndicator(Resource.Mipmap.ic_menu);
              drawerLayout = FindViewById&lt;DrawerLayout&gt;(Resource.Id.drawer_layout);
              navigationView = FindViewById&lt;NavigationView&gt;(Resource.Id.nav_view);
  
          }
  
          public override bool OnOptionsItemSelected(IMenuItem item)   
          {  
              Intent intent = null;
  
              //Console.WriteLine("ID = " + item.ItemId);
  
              switch (item.ItemId)   
              {  
                  case Android.Resource.Id.Home:  
                      drawerLayout.OpenDrawer(Android.Support.V4.View.GravityCompat.Start);  
                      break;
  
                  case Android.Resource.chi_siamo :
                      intent = new Intent(this, typeof(ChiSiamoActivity));
                      break;
  
                  case Android.Resource.Id.nostro_centro:
                      intent = new Intent(this, typeof(NostroCentroActivity));
                      break;
  
                  case Android.Resource.Id.servizi_paziente:
                      intent = new Intent(this, typeof(ServiziPazienteActivity));
                      break;
  
                  case Android.Resource.Id.my_sofis:
                      intent = new Intent(this, typeof(MySofisActivity));
                      break;
  
                  case Android.Resource.Id.contatti:
                      intent = new Intent(this, typeof(ContattiActivity));
                      break;
  
                  case Android.Resource.Id.lavora_con_noi:
                      intent = new Intent(this, typeof(LavoraConNoiActivity));
                      break;
  
                  default://invalid option
                      return base.OnOptionsItemSelected(item);
              } 
  
              if (intent != null)
              {
                  StartActivity(intent);
              }
  
              return base.OnOptionsItemSelected(item);  
          }
  </code></pre>
  
  <p>I have two main layouts:</p>
  
  <p><strong>Layout/Main.axml</strong><br>
  <strong>Layout/menu/menu.xml</strong></p>
  
  <p><strong>menu.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;  
  &lt;menu  
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;  
      &lt;group android:checkableBehavior="single"&gt;  
          &lt;item  
              android:id="@+id/chi_siamo"  
              android:title="CHI SIAMO"
           /&gt;  
          &lt;item  
              android:id="@+id/nostro_centro"  
              android:title="Il NOSTRO CENTRO" /&gt;  
          &lt;item  
              android:id="@+id/servizi_paziente"  
              android:title="SERVIZI PER IL PAZIENTE" /&gt;  
  
          &lt;item  
              android:id="@+id/my_sofis"  
              android:title="MY SOFIS" /&gt; 
  
          &lt;item  
              android:id="@+id/contatti"  
              android:title="CONTATTI" /&gt; 
  
          &lt;item  
              android:id="@+id/lavora_con_noi"  
              android:title="LAVORA CON NOI" /&gt; 
      &lt;/group&gt;  
  &lt;/menu&gt;   
  </code></pre>
  
  <p>The issue is that "case Android.Resource.chi_siamo" doesn't get the ID so i can not start specific activity. </p>
  
  <p>How can i get ID name and validate it ? 
  Thank you for your help!</p>