Hello,
I am trying to create my own a menu item in built-in Contacts application. And when clicking on that menu item will have to launch my application with the contact details which has chosen.
I could able to add my own menu item into native Contacts app menu. It is showing it on BB 4.7 Simulator.
amir.addMenuItem(ApplicationMenuItemRepository.MENUITEM_ADDRESSBOOK_LIST, contactsDemoMenuItem);
I am trying to launch my application screen with detail of the selected contact.
I follow the code for that,
public class SampleMenuItem extends ApplicationMenuItem
{
Contact mContact;
SampleMenuItem()
{
super(20);
}
public Object run(Object context)
{
if (context instanceof Contact)
{
mContact = (Contact) context;
pushScreen(new MyAppNextScreen(<Here i need to pass a string which should have contact name and mobile number appended>));
}
return context;
}
But when a click on menu item from native contacts, it is succedully launching to my application. No issues here too. But i want to know how can i pull up the selected contact detail from Native contact to my application. I use "context instanceof Contact". I have to go through the record and pick only contact name and mobile number. How can i achieve it?
Thank you.