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

Reply
Developer
jllarraz
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.

 

Please use plain text.
Developer
jllarraz
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

Please use plain text.
Developer
jllarraz
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? 

Please use plain text.
Developer
jllarraz
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?    

Please use plain text.
Administrator
MSohm
Posts: 14,554
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook

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.
Found a bug? Report it using Issue Tracker
Please use plain text.