krishna
krishna

Reputation: 998

Override default menu in blackberry

I want to override default menu items. For example, ask for password when DELETE menu of download screen is pressed. For that, I need to override delete menu item of blackberry default menu of download screen.

Upvotes: 2

Views: 548

Answers (2)

dvs
dvs

Reputation: 12432

Any default BlackBerry menu item can be removed using this technique:

protected void makeMenu(Menu menu, int instance)
{
    // Remove Delete menu item
    for( int i = 0; i < menu.getSize(); ++i )
    {
        MenuItem item = menu.getItem(i);
        if( item.toString().equals("Delete") )
        {
            menu.deleteItem(i);
            break;
        }
    }

    super.makeMenu(menu, instance);
}

Upvotes: 1

user784540
user784540

Reputation:

There is no way to do that unless you may extend a screen that shows this menu item.

Then you may override makeMenu() method and amend menu items list.

Upvotes: 1

Related Questions