What are the differences between the following types of menus in Android?
option menu
context menu
sub menu
Can anyone give me an explanation and an example for each?
Option menu: The menu that appears when you press the menu button
Context menu: The menu that appears like a dialog with a list when you (mostly) longpress on list elements
Sub menu: can be used to display more menu items with your option menu.
More details: http://developer.android.com/guide/topics/ui/menus.html
Related
What are the differences between Context menu vs Popup menu vs bottom sheet?
and what kind of situations they are best fit for?
Option Menu Option Menus are the primary menus of android. They can be used for settings, search, delete item etc. we are inflating the menu by calling the inflate() method of MenuInflater class. To perform event handling on menu items, you need to override onOptionsItemSelected() method of Activity class.
Context Menu Android context menu appears when user press long click on the element. It is also known as floating menu.
Bottom sheets bottom sheet is a sheet of material that slides up from the bottom edge of the screen and presents a set of clear and simple actions
Please read this SO Answer difference-between-context-menu-and-option-menu-in-android
Bottom sheet is an Android component that present anchored views at the bottom of the screen. It became popular on Android 5, you can find more information in the Material Design documentation.
Popup menu is a dialog box linked to a concrete element in the UI, with it you can implement the Quick Actions UI pattern.
⦁ Pop-up menu/context Menu - A context menu (also called contextual, shortcut, and popup or pop-up menu) is a menu in a graphical user interface (GUI) that appears upon user interaction, such as a right-click mouse operation.
⦁ Fall-down menu - move the mouse over the menu to open it. In a computer, a drop-down menu is a menu that offers a list of options. The title of the menu, of the currently-selected item in the list, is always displayed. When the visible item is clicked, other items from the list "drop-down" into view, and the user can choose from those options.
I'm using ActionBarSherlock and I wonder if it is possible to have a popup menu at the bottom of the screen additionally? I'd like this menu to appear when the user clicks the default menu button (hardware for older mobiles).
How can I do this?
The actionbar menu overflow is automatically replaced by items in "menu" popup if you have a hardware menu button.
http://developer.android.com/design/patterns/compatibility.html
In order for items to appear in there you should set
android:showAsAction="never"
to your menu items
You must take a look at the How to Create Android Menus?
I hope this will help you.
Android buttons are moving or navigating from menu activity to submenu activity,But not moving from submenu buttons to its another submenu buttons. can u explain with code
http://developer.android.com/guide/topics/ui/menus.html
documentation specifies that it is not possible to create submenus for submenus in android, you'll mostly have to write your own...
this might help - Submenu within menu within menu?
What is the difference between Menu and Context Menu? How they are creating in android, menu including edit, delete, copy and many other option in android. here, by using list items during creating context menu and menu.
There are three types of Menus
Option Menu (If you click on Hardware Menu button your option menu will come into play)
Context Menu (If you long click on any list item in list view (your context menu will come into play we have to register context menu to work)
SubMenu
Can you please tell me the difference between context menu and option menu in android?
When I click the menu button on the emulator, is that option menu? or context menu?
And how to invoke the other menu (not trigger by the menu button)?
Thank you.
When I click the menu button on the
emulator, is that option menu?
Yes.
And how to invoke the other menu (not
trigger by the menu button)?
By long-tapping on whatever widget (if any) has a context menu.
The page on UI Guidelines and Menu Design in the Android documentation gives a good explaination of each of the types of menus.
Two line summary:
Options Menu - the menu you see when pressing the 'Menu' button
Context Menu - the menu shown when you press and hold an item.
Google provides an extensive summary of the different menu types in their documentation.
Excerpt:
Options menu and action bar
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."
If you're developing for Android 2.3 or lower, users can reveal the options menu panel by pressing the Menu button.
On Android 3.0 and higher, items from the options menu are presented by the action bar as a combination of on-screen action items and overflow options. Beginning with Android 3.0, the Menu button is deprecated (some devices don't have one), so you should migrate toward using the action bar to provide access to actions and other options.
Context menu and contextual action mode
A context menu is a floating menu that appears when the user performs a long-click on an element. It provides actions that affect the selected content or context frame.
When developing for Android 3.0 and higher, you should instead use the contextual action mode to enable actions on selected content. This mode displays action items that affect the selected content in a bar at the top of the screen and allows the user to select multiple items.