I'm trying to add a menuItem to the contact's contextMenu for every contact with email address, and for those who does not have an email address i want to grey the menu or remove it.
all i managed to do is add a menuItem to all contacts.
I tried to add an ApplicationMenuItem with specific Contact context from the PIM:
Contact c = (Contact)contacts.elementAt(i);
amir.addMenuItem(ApplicationMenuItemRepository.MENUITEM_ADDRESSCARD_VIEW, new SampleMenuItem(c));
contacts is a vector of PIM Contacts
amir is ApplicationMenuItemRepository
SampleMenuItem is a class that extends ApplicationMenuItem
Is this code is right? what am i missing here?
I see no difference between ApplicationMenuItem contructor with Contact context and the constructor without Contact context.
public ApplicationMenuItem(Object context, int order)
public ApplicationMenuItem(int order)