Android Learning seven Menu

Source: Internet
Author: User

1. Menu Categories

    • General Menu
    • Sub-Menu
    • Context Menu
    • Icon Menu
    • Secondary Menu
    • Alternate Menu
2. Menu Class Andriod.view.menu 3. Menu Parameter Name: string header Menu ID: Integer Group ID: Indicates which group the item is in (Group-related function Removgroup (ID) setgroupcheckable (id,checkab le,exclusive) setgroupenabled (id,boolean,enabled) setgroupvisible (id,visible)) sort: An integer that specifies the order of the menu item in the menumenu.add (1,//group ID4,//item ID4,//order, the numbers are big."Four"//name);4. Menu structure: A menu can include multiple menu items, multiple sub-menus,  A submenu can include multiple menu items and submenus 5.activity creates a menu instance and then calls the Oncreateoptionmenu callback method, invoking the activity's callback method when the menu item is selected onoptionitemselected 6. You can create a context menu for long-click events for a view. An option menu can be associated with only one activity, but multiple context menus can be related to multiple views under that activity. 7. You can add to this app a menu of other apps that can handle a type of data (the intent filter is declared). 8. You can create a menu from the XML.

Android Learning seven Menu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.