Menus


The Menu APIs present user actions and other options in your activities, whereas the Action Bar icon is 3 small stacked boxes icon know as action overflow. There are two menus for this app, menu_main and menu_next, one for each page. The menu menu_main is given below and the file menu_next is similar.

HelloWorld/app/src/main/res/menu/menu_main.xml
<menu
  xmlns:android = "http://schemas.android.com/apk/res/android"
  xmlns:app     = "http://schemas.android.com/apk/res-auto"
  xmlns:tools   = "http://schemas.android.com/tools"
  tools:context = ".NextActivity">
  <item
    android:id              = "@+id/action_settings"
    android:title           = "@string/action_settings"
    android:orderInCategory = "100"
    app:showAsAction        = "never" />
  <item
    android:id              = "@+id/next"
    android:title           = "Next Page"
    android:orderInCategory = "100"
    app:showAsAction        = "never" />
</menu>
android:orderInCategory="100"
This attribute dictates the order in which the menu items will appear within the menu when it is displayed. The menu items are arranged from left to right in ascending order of integer value of orderInCategory (i.e. 1,2,3... ⇒ left to right).

app:showAsAction="never"
When and how this item should appear as an action item in the app bar. The values include “never,” “always,” and “ifRoom.”



      Boy: What’s your age?    
      Girl: Girls don’t reveal our age to boys.    
      Boy: What is your email address?    
      Girl: pari.2001@gmail.com