Android Guides | Samples

Android.Views.IMenu.AddIntentOptions Method

Add a group of menu items corresponding to actions that can be performed for a particular Intent.


[Android.Runtime.Register("addIntentOptions", "(IIILandroid/content/ComponentName;[Landroid/content/Intent;Landroid/content/Intent;I[Landroid/view/MenuItem;)I", "GetAddIntentOptions_IIILandroid_content_ComponentName_arrayLandroid_content_Intent_Landroid_content_Intent_IarrayLandroid_view_MenuItem_Handler:Android.Views.IMenuInvoker, Mono.Android, Version=, Culture=neutral, PublicKeyToken=null")]
public Int32 AddIntentOptions (Int32 groupId, Int32 itemId, Int32 order, ComponentName caller, Intent[] specifics, Intent intent, [Android.Runtime.GeneratedEnum] MenuAppendFlags flags, IMenuItem[] outSpecificItems)

See Also


The group identifier that the items should be part of. This can also be used to define groups of items for batch state changes. Normally use Menu.None if the items should not be in a group.
Unique item ID. Use Menu.None if you do not need a unique ID.
The order for the items. Use Menu.None if you do not care about the order. See IMenuItem.Order.
The current activity component name as defined by queryIntentActivityOptions().
Specific items to place first as defined by queryIntentActivityOptions().
Intent describing the kinds of items to populate in the list as defined by queryIntentActivityOptions().
Additional options controlling how the items are added.
Optional array in which to place the menu items that were generated for each of the specifics that were requested. Entries may be null if no activity was found for that specific action.


Add a group of menu items corresponding to actions that can be performed for a particular Intent. The Intent is most often configured with a null action, the data that the current activity is working with, and includes either the Intent.CategoryAlternative or Intent.CategorySelectedAlternative to find activities that have said they would like to be included as optional action. You can, however, use any Intent you want.

See PackageManager.QueryIntentActivityOptions(ComponentName,Intent[],Intent[],Intent[]) for more * details on the caller, specifics, and intent arguments. The list returned by that function is used to populate the resulting menu items.

All of the menu items of possible options for the intent will be added with the given group and id. You can use the group to control ordering of the items in relation to other items in the menu. Normally this function will automatically remove any existing items in the menu in the same group and place a divider above and below the added items; this behavior can be modified with the flags parameter. For each of the generated items IMenuItem.SetIntent(Intent) is called to associate the appropriate Intent with the item; this means the activity will automatically be started for you without having to do anything else.

[Android Documentation]


Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions:
Since: Added in API level 1