Skip to content

Instantly share code, notes, and snippets.

@girish3
Last active February 17, 2019 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save girish3/fd7a4b347ab94c358004df7174f893aa to your computer and use it in GitHub Desktop.
Save girish3/fd7a4b347ab94c358004df7174f893aa to your computer and use it in GitHub Desktop.
[Menus] Menus are common user interface component in Android. It provides consistent user experience at the cost of flexibility. #android_snippet #android #android_tutorial #tutorial

Menus are common user interface component in Android. It provides consistent user experience at the cost of flexibility. You should use the Menu APIs to present user actions and other options in your activities.

There are 3 types of Menu:

Options menu

The options menu is the primary collection of menu items for an activity. It's where you should place actions that have a global impact on the app, such as "Search," "Compose email," and "Settings."

Context menu and contextual action mode

A context menu is a floating menu, like dialog, that appears when the user performs a long-click on an element. It provides actions that affect the selected content or context frame.

Popup menu

A popup menu displays a list of items in a vertical list that's anchored to the view that invoked the menu. It's good for providing an overflow of actions that relate to specific content or to provide options for a second part of a command, the popup menu is for extended actions that relate to regions of content in your activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment