Remove a link
You can remove a link between a contact in your application and a contact in the Contacts application on the BlackBerry® device.
- Import the required classes and interfaces.
import net.rim.blackberry.api.pdap.contactlinking.*;
- Retrieve the contact in the Contacts application that is linked to your contact.
BlackBerryContact contact =
LinkedContactUtilities.getLinkedContact(linkableContact);
- Remove the link between the contacts.
LinkedContactUtilities.unlinkContact(contact, linkableContact.getApplicationID());
Code sample: Removing a link
private void unlinkContact(LinkableContact linkableContact)
{
BlackBerryContact contact =
LinkedContactUtilities.getLinkedContact(linkableContact);
if(contact != null)
{
LinkedContactUtilities.unlinkContact(contact,
linkableContact.getApplicationID());
}
}
Was this information helpful? Send us your comments.