Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 47
Registered: ‎01-09-2009
My Device: Not Specified
Accepted Solution

How to persist a menu item deletion?

I am looking for help on how to delete a menu item from my application. More specifically, how to persist my deletion of the menu item

The code sample below, does delete the menu item but when I restart the application, the menu item is back.

 

Any help on what to do after calling removeMenuItem is appreciated.

 

 

        MyMenuItem _addLicenseItem = new MyMenuItem();

        addMenuItem(_addLicenseItem); 

 

...

 

 

 

    ///////////////////////////////////////////////////////////////////

    // Inner classes

    ///////////////////////////////////////////////////////////////////

    private class MyMenuItem extends MenuItem

    {      

        private MyMenuItem()

        {

            super("My Menu" , 0x00010000, 13);

        }

        public void run()

        {

           

            removeMenuItem(this);

        }

    }

Developer
Posts: 47
Registered: ‎01-09-2009
My Device: Not Specified

Re: How to persist a menu item deletion?

Issue resolved.

Please ignore.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to persist a menu item deletion?

Can you please mark this as Solved, so that we don't look?

 

Also, a hint as to how you resolved it could be useful to the next person.

Developer
Posts: 47
Registered: ‎01-09-2009
My Device: Not Specified

Re: How to persist a menu item deletion?

Sure,

After the menu Item is removed I write a flag to the persistent store.

When the application is started again, if the flag is set, I don’t display the menu item.

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to persist a menu item deletion?

Makes sense to me!

 

To mark this as solved, can you follow the instructions in the help, quick link here:

http://supportforums.blackberry.com/rim/help_faq#solution_whatis