This function adds a menu item to the collection.
addMenuItem( title, callback, [isDefault] )
Name | Type | Argument | Description |
title | string | The display text for the menu item. | |
callback | anonymous.genericCallbackFunction | The function to call when the menu item is clicked. | |
isDefault | boolean | (optional) | Determines if the menu item is selected by default on BlackBerry.If more than one menu item is added to the same collection with true for this parameter, the last menu item added with true for this parameter will be selected by default on Blackberry. |
var callbackFunctionName = function() { alert( "Menu item clicked!" ); } var menuItemCollection = new hwc.MenuItemCollection(); menuItemCollection.addMenuItem("menu item name", "callbackFunctionName()", true);