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: 16,517
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
Accepted Solution

ApplicationMessageFolderRegistry unregister MessageMenuItems?

My whole application runs in autostart. I register an ApplicationMessageFolder, some types of messages and finally an ApplicationMenuItem for my messages.

When i quit my application i call applicationMessageFolderRegistry.unregisterFolder.

It seems that the menu items, however, are not unregistered.

There are no methods to unregister menu items.

 

Is this a flaw in the API or am I overlooking something?

 

I can kind of use a workaround by putting the menu item into the runtimestore, but i have to use global events then as it seems to refer to an old (nonexisting) instance of my application.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: ApplicationMessageFolderRegistry unregister MessageMenuItems?

I am guessing you are using ApplicationMenuItemRepository to register the menu items (can't find any other way).

 

Have you tried calling ApplicationMenuItemRepository.removeMenuItem(long, ApplicationMenuItem) before calling ApplicationMessageFolderRegistry.unregisterFolder?

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 16,517
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: ApplicationMessageFolderRegistry unregister MessageMenuItems?

No, i am using

http://www.blackberry.com/developers/docs/5.0.0api/net/rim/blackberry/api/messagelist/ApplicationMes...(int, int, net.rim.blackberry.api.menuitem.ApplicationMenuItem[])

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: ApplicationMessageFolderRegistry unregister MessageMenuItems?

Beats me then, I didn't see that function.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 16,517
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: ApplicationMessageFolderRegistry unregister MessageMenuItems?

applicationmessagefolderregistry does also not work with the 5.0 hot swap feature, i get multiple folders despite checking for the ID before registering. luckily this is not coming up when i restart the application regularly.

i am avoiding multiple menu items using runtimestore now, maybe going to file a bug if i have the time.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 723
Registered: ‎03-12-2009
My Device: Playbook

Re: ApplicationMessageFolderRegistry unregister MessageMenuItems?

[ Edited ]

I'm experiencing the same thing as you are.    Don't even have to hot swap the simulator, just exiting the app causes it.   Calling unregisterFolder does not remove the menu option.

 

Found a fix by any chance?   

 

Runtime store is not the most elegant solution =\   Can't really delete menu items that way...

Developer
Posts: 723
Registered: ‎03-12-2009
My Device: Playbook

Re: ApplicationMessageFolderRegistry unregister MessageMenuItems?

 


simon_hain wrote:

applicationmessagefolderregistry does also not work with the 5.0 hot swap feature, i get multiple folders despite checking for the ID before registering. luckily this is not coming up when i restart the application regularly.

i am avoiding multiple menu items using runtimestore now, maybe going to file a bug if i have the time.


 

I am experiencing something different.

 

I am using the runtime store to store the singleton of the menu item, but it is still showing up dulicated.

 

The interesting part, is that both menu items fire away with the SAME application descriptor and open my app.   So no need to use global events, but the menu items are duplicated.  Even though it's the same object....    

 

 

Developer
Posts: 70
Registered: ‎11-30-2009
My Device: Not Specified

Re: ApplicationMessageFolderRegistry unregister MessageMenuItems?

     I know this is an old thread but has there any fix released about this issue yet ? Or has anybody found a workaround ? I've encountered the exact same problem : I can't unregister my applicationMenuItems, therefore they occur more than only once in my menu whereas they're not suposed to...

 

     Thanks.

Developer
Posts: 16,517
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: ApplicationMessageFolderRegistry unregister MessageMenuItems?

[ Edited ]

I check for the existance of the folder beforehand.

 

 

inbox = applicationMessageFolderRegistry.getApplicationFolder(MESSAGE_FOLDER_INBOX); 
if (inbox != null) { 
   return; 
}

 

 

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 70
Registered: ‎11-30-2009
My Device: Not Specified

Re: ApplicationMessageFolderRegistry unregister MessageMenuItems?

That may work. Problem is that I unregister my folder when I initialize my application... but I'll figure something out to be able tu use this trick.

 

Thanks for the advice !