Språk

Fragment.OnCreateOptionsMenu(IMenu, MenuInflater) Method

Definition

Initialize the contents of the Activity's standard options menu.

[Android.Runtime.Register("onCreateOptionsMenu", "(Landroid/view/Menu;Landroid/view/MenuInflater;)V", "GetOnCreateOptionsMenu_Landroid_view_Menu_Landroid_view_MenuInflater_Handler")]
public virtual void OnCreateOptionsMenu(Android.Views.IMenu? menu, Android.Views.MenuInflater? inflater);
[<Android.Runtime.Register("onCreateOptionsMenu", "(Landroid/view/Menu;Landroid/view/MenuInflater;)V", "GetOnCreateOptionsMenu_Landroid_view_Menu_Landroid_view_MenuInflater_Handler")>]
abstract member OnCreateOptionsMenu : Android.Views.IMenu * Android.Views.MenuInflater -> unit
override this.OnCreateOptionsMenu : Android.Views.IMenu * Android.Views.MenuInflater -> unit

Parameters

menu
IMenu

The options menu in which you place your items.

inflater
MenuInflater

MenuInflater

Attributes

Remarks

Initializes the activity's standard options menu. Add menu items to menu. For this method to be called, first call SetHasOptionsMenu(Boolean) with true. The fragment must not be hidden, and its menu must be visible. See OnCreateOptionsMenu(IMenu) for more information.

Android reference for android.app.Fragment.onCreateOptionsMenu.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also