Retrieve a contact list UID

You can open a contact list on a BlackBerry® device by specifying a system-assigned name or a UID. The UID is associated with a BlackBerry® Enterprise Server account and persists across all BlackBerry device changes, including OS updates. You can open the contact list by its UID by invoking BlackBerryPIM.openPIMList(int pimListType, int mode, long uid).

  1. Import the required classes and interfaces.
    import net.rim.blackberry.api.pdap.BlackBerryContactList;
    import net.rim.blackberry.api.pdap.BlackBerryPIMList;
    import javax.microedition.pim.PIM;
    import javax.microedition.pim.PIMException;
    import javax.microedition.pim.PIMItem;
  2. Access the contact list that you want to work with.
  3. Invoke BlackBerryPIMList.getPIMListUID() to retrieve the UID of the contact list.
    long uid = list.getPIMListUID(); 
Next topic: Export a contact

Was this information helpful? Send us your comments.