07-19-2012 09:18 AM
Hi,
I have made an application which invokes message application in view mode(message content). I am adding one custom menuitem (MENUITEM_EMAIL_VIEW)just before invoking the message so that it can appear in native message view screen.
I am removing the menuitem in onClose method of the screen but it doesn't seem to remove that because I am getting multiple menuitems.I am passing proper menu object refrence.
Any help?
Solved! Go to Solution.
07-19-2012 09:28 AM
"I am removing the menuitem in onClose method of the screen but it doesn't seem to remove that because I am getting multiple menuitems.I am passing proper menu object reference"
My experience is if you do pass the correct Object it will be deleted. If you don't, it won't be deleted and your request is silently ignored. My suspicious is that in fact you are not supplying the same Object. You might be supplying the same reference but it is the Object that is important.
07-20-2012 04:37 AM
I am adding my menuitem before invoking message application using below code:
ApplicationMenuItemRepository.getInstance().addMen
(ApplicationMenuItemRepository.MENUITEM_EMAIL_VIEW
and removing it in onClose method like
ApplicationMenuItemRepository.getInstance().remove
(ApplicationMenuItemRepository.MENUITEM_EMAIL_VIEW
07-20-2012 04:41 AM
Two tests:
a) Make sure that you do go through the onClose() method. Put a break point in there and go through your processing and see if it is hit.
b) Change your add code to the following:
ApplicationMenuItemRepository.getInstance().addMen
(ApplicationMenuItemRepository.MENUITEM_EMAIL_VIEW
ApplicationMenuItemRepository.getInstance().remove
(ApplicationMenuItemRepository.MENUITEM_EMAIL_VIEW
ApplicationMenuItemRepository.getInstance().addMen
(ApplicationMenuItemRepository.MENUITEM_EMAIL_VIEW
Now if the remove is failing, you should get two entries everytime. Do you?
07-20-2012 06:01 AM
Thanks a lote for helping me.
I made a silly mistake,I was creating a new instance of custom menu whenever it comes to the method which invokes message apps.
Thanks a lot for helping