Partager via


Fragment.SetHasOptionsMenu(Boolean) Method

Definition

Report that this fragment would like to participate in populating the options menu by receiving a call to #onCreateOptionsMenu and related methods.

[Android.Runtime.Register("setHasOptionsMenu", "(Z)V", "GetSetHasOptionsMenu_ZHandler")]
public virtual void SetHasOptionsMenu (bool hasMenu);
[<Android.Runtime.Register("setHasOptionsMenu", "(Z)V", "GetSetHasOptionsMenu_ZHandler")>]
abstract member SetHasOptionsMenu : bool -> unit
override this.SetHasOptionsMenu : bool -> unit

Parameters

hasMenu
Boolean

If true, the fragment has menu items to contribute.

Attributes

Remarks

Report that this fragment would like to participate in populating the options menu by receiving a call to #onCreateOptionsMenu and related methods.

Java documentation for android.app.Fragment.setHasOptionsMenu(boolean).

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