04-25-2011 09:07 AM
this is my first post and i am rather new to Blackberry Java Development...
so in my app:
I've created custom menu and register it with ID MENUITEM_SYSTEM, now i have a problem creating method to remove this custom menu.
I've read in some thread that you have to make sure that the menuitem you want to remove with removeMenuItem(id, menuitem) is the same menuitem that has been created before, so you have to know the id of that menuitem, store it in Runtime or Persistent Store...
My question is, how can i retrieve this menuitem id that i've created before?
is this the same value with the one i get from menuitem.hashCode()?
and if can somehow get the menuitem id, how can i remove it?since the method is removeMenuItem(id, menuitem), and id here represents MENUITEM_SYSTEM, which method should i use to do the job?
hope someone can help,
Thx in advance..
and sorry for my poor english
Solved! Go to Solution.
04-25-2011 12:27 PM
Yeah i just discovered a way using Runtime Store
when first created, i registered the menuItem to Runtime Store with unique ID,
then, when i want to remove that, simply invoke Runtime Store with the ID registered before, and i get an Object that is, the menuItem.
after that with casting the Object as my menuItem class, i called remove(id, menuItemObject)..voila, the menuItem is removed!
So i'll just mark this as solved
Thx though for your explanation