Forum Xamarin.Android


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Menu Inflate

meirrotfleischmeirrotfleisch USMember ✭✭✭

I added a folder under my Resources called "menu" and added my home.xml file

When I try

MenuInflater.Inflate(Resource.Menu.home, menu);

It says the resource Menu doesn't exist ..

I have done a "clean" "rebuild" but nothing helps

Suggestions Please




  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Please refer to following steps to create a Menu file.

    First of all, create a folder called menu in the Resources folder like following screenshot.

    Then right click the menu folder, add a new item.

    click the Android tab, select the Menu type file like following screenshot.

    In the end, Add you item.

    <?xml version="1.0" encoding="utf-8" ?>
    <!--For all properties see:>
    <menu xmlns:android="">
      <item android:id="@+id/action_search"

    Open your activity, override the OnCreateOptionsMenu method.

      public override bool OnCreateOptionsMenu(IMenu menu)
                MenuInflater.Inflate(Resource.Menu.menu1, menu);
                return true;

    Here is my demo, you can test it. 114.5K
Sign In or Register to comment.