Display Menu options in a fragment

I have a fragment, on which I implement

public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            inflater.Inflate(Resource.Menu.top_menus, menu);
            base.OnCreateOptionsMenu(menu, inflater);
        }

And the OnCreate of this fragment is

    public override void OnCreate(Bundle savedInstanceState)
            {
                base.OnCreate(savedInstanceState);
                HasOptionsMenu = true;
            }

But the method "OnCreateOptionsMenu" is never called, and the Menu is not showing in the Fragment. Why?

Tagged:
Sign In or Register to comment.