Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 69
Registered: ‎08-13-2008
My Device: Not Specified
Accepted Solution

How can i manage Contacts groups?

Hi

 

I have tried to manage contact groups but without results, i think that it could be with PimList.getCategories(); but no results.

 

Thanks.

 

Developer
Posts: 69
Registered: ‎08-13-2008
My Device: Not Specified

Re: How can i manage Contacts groups?

Hi

 

i have found that when yo make a contactList.items(), the items returned contains the groups but they are objects of type

 

net.rim.device.apps.internal.addressbook.groupaddresscard.GroupAddressCardMember@3061a7d3

 

I have try with instanceof BlackBerryContactGroup, because i dont know what kind of object is this GroupAddresCardModelImpl

 

thanks

Highlighted
Developer
Posts: 69
Registered: ‎08-13-2008
My Device: Not Specified

Re: How can i manage Contacts groups?

this is very strange, when you use the debugger and see the items you can see the contacts and the groups in the field _addressCards, but when you use

 

Enumeration items = contactList.items();

 

while(items.hasMoreElements())
{
     Object nextElement = items.nextElement();

}

 

you only have the contacts, why if you have the groups in the items when you make the loop you only have the contacts? 

Developer
Posts: 69
Registered: ‎08-13-2008
My Device: Not Specified

Re: How can i manage Contacts groups?

I have found a solution to list the contact groups

 

BlackBerryContactList contactList = (BlackBerryContactList)BlackBerryPIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
                 
Enumeration items = contactList.items(BlackBerryContactList.SEARCH_GROUPS);   

 

but still i need to create new groups, in the api said that i can only read the groups there is any way to create and update groups?    

BlackBerry Development Advisor
Posts: 15,888
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: How can i manage Contacts groups?

From a third party application's point of view, contact groups are read only.  They can not be created or modified pragmatically.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.