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.

  1. Import the required classes and interfaces.
    import net.rim.blackberry.api.pdap.contactlinking.*;
  2. Retrieve the contact in the Contacts application that is linked to your contact.
    BlackBerryContact contact = 
        LinkedContactUtilities.getLinkedContact(linkableContact);
  3. 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());
    }
}   
Previous topic: Link a contact

Was this information helpful? Send us your comments.