Sdílet prostřednictvím


Fragment.OnPrepareOptionsMenu(IMenu) Method

Definition

Prepare the Screen's standard options menu to be displayed.

[Android.Runtime.Register("onPrepareOptionsMenu", "(Landroid/view/Menu;)V", "GetOnPrepareOptionsMenu_Landroid_view_Menu_Handler")]
public virtual void OnPrepareOptionsMenu (Android.Views.IMenu? menu);
[<Android.Runtime.Register("onPrepareOptionsMenu", "(Landroid/view/Menu;)V", "GetOnPrepareOptionsMenu_Landroid_view_Menu_Handler")>]
abstract member OnPrepareOptionsMenu : Android.Views.IMenu -> unit
override this.OnPrepareOptionsMenu : Android.Views.IMenu -> unit

Parameters

menu
IMenu

The options menu as last shown or first initialized by onCreateOptionsMenu().

Attributes

Remarks

Prepare the Screen's standard options menu to be displayed. This is called right before the menu is shown, every time it is shown. You can use this method to efficiently enable/disable items or otherwise dynamically modify the contents. See Activity#onPrepareOptionsMenu(Menu) Activity.onPrepareOptionsMenu for more information.

Java documentation for android.app.Fragment.onPrepareOptionsMenu(android.view.Menu).

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