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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
kmm1001
Posts: 47
Registered: ‎01-09-2009
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);

        }

    }

Please use plain text.
Developer
kmm1001
Posts: 47
Registered: ‎01-09-2009

Re: How to persist a menu item deletion?

Issue resolved.

Please ignore.

Please use plain text.
Developer
peter_strange
Posts: 17,713
Registered: ‎07-14-2008

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.

Please use plain text.
Developer
kmm1001
Posts: 47
Registered: ‎01-09-2009

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.

Please use plain text.
Developer
peter_strange
Posts: 17,713
Registered: ‎07-14-2008

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

Please use plain text.