pdf, epub, azw3, mobi | 12.43 MB | English | Isbn: B09B645D1F | Author: Bhangale, Chetan | Year: 2021
In almost all applications we encounter menus that display options in the form of menu items.
Choosing a menu item results in the initiation of the desired task. Menus are therefore the
preferred way of indicating the possible actions in an application.
The ActionBar is a widget that replaces the title bar at the top of an Activity displaying
navigation and important functionality of an application. It provides a consistent UI of an
application. It also displays the key actions that are commonly used in an application and that
are constantly visible on the screen. ActionBar is also commonly used to provide a quick link to
an application’s home.
MENUS AND THEIR TYPES
Android SDK supports three types of menus: Options, Submenu, and Context, as detailed in the
• Options Menu-Also known as the Activity menu, this menu is displayed when a MENU
button is clicked. In an Options Menu, the menu items are displayed in the form of text, check
box, or radio buttons. It can display shortcut keys but does not display icons. In older Android
API levels (Levels 10 and below), there were two types of Options Menus:
• Icon Menu-The Icon Menu appears when the user presses the MENU button on the device.
The Icon Menu shows the first six menu items of the menu in the form of large, finger-friendly
buttons arranged in a grid at the bottom of the screen. The menu items in the Icon Menu can
display icons as well as text. The Icon Menu does not display check boxes, radio buttons, or the
shortcut keys for menu items. It is not mandatory to have icons for Icon Menu items; text will
also do for the Icon Menu.
• Expanded Menu-If the menu has more than six menu items, the first five items are
displayed as an Icon Menu and the sixth option appears as a More button. Clicking the More
button displays the Expanded Menu that shows the scrollable list of the rest of the menu items
that could not be accommodated in the Icon Menu. The Expanded Menu can display menu
items in the form of text, check boxes, or radio buttons. Also, it can display shortcut keys but
does not display icons. Pressing the Back button from the Expanded Menu takes you back to
the Activity the menu was launched from.