Add method of Menu Control in Android

Source: Internet
Author: User
Public abstract menuitem add (INT groupid, int Itemid, int order, int titleres) added in API Level 1 variation on add (INT, Int, Int, charsequence) that takes a string resource identifier instead of the string itself. parametersgroupid the Group Identifier that this item shocould be part. this can also be used to define groups of items for batch state changes. normally use none if an item shocould not be in a group. itemid unique item ID. use none if you do not need a unique ID. order the order for the item. use none if you do not care about the order. see getorder (). titleres resource identifier of title string. returnsthe newly added menu item.

 

 

The first int type group ID parameter represents the group concept. You can group several menu items to better manage your menu buttons in a group.
The item ID parameter of the second int type represents the project number. This parameter is very important. An item ID corresponds to an option in a menu. This item ID is used to determine which option you are using when using the menu later.
The third 'order id' parameter of 'int' type represents the order in which menu items are displayed. The default value is 0, indicating that the display order of the menu is displayed according to the display order of ADD.
The fourth string type title parameter, indicating the text displayed in the option.

Related Article

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.