The contact group problem

Help, please.

There is a code in which I get a contact name.
How to get the name of the Group?

try {          PIM pim = PIM.getInstance();          BlackBerryContactList contacts = (BlackBerryContactList) pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);          Enumeration items = contacts.items(BlackBerryContactList.SEARCH_CONTACTS);          while (items.hasMoreElements())            {                BlackBerryContact contact = (BlackBerryContact) items.nextElement();                // Get first name ane last name contac;                String displayName = null;

                if (contact.countValues(Contact.NAME) > 0) {                    final String[] name = contact.getStringArray(Contact.NAME, 0);                    final String firstName = name[Contact.NAME_GIVEN];                    final String lastName = name[Contact.NAME_FAMILY];                            if (firstName != null && lastName != null) {                        displayName = firstName + " " + lastName;                    } else if (firstName != null) {                        displayName = firstName;                    } else if (lastName != null) {                        displayName = lastName;                    }

                    if (displayName != null)                     {                        final String namePrefix = name[Contact.NAME_PREFIX];                        if (namePrefix != null) {                            displayName = namePrefix + " " + displayName;                        }                                        }                }

            }            items = contacts.items(BlackBerryContactList.SEARCH_GROUPS);            while (items.hasMoreElements())            {                BlackBerryContactGroup group = (BlackBerryContactGroup) items.nextElement();                // HOW GET GROUP NAME ???

            }

        } catch (final Exception e) {}

Thank you to.
good job.
It is possible to get contacts, which consist of a group?

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for