09-13-2010 02:38 PM
hi
I just want to know that how we can get all email ids from contacts that we have saved before?
09-14-2010 09:14 AM
This Link will be helpfull for u.
http://supportforums.blackberry.com/t5/Java-Develo
--------------------------------------------------
Press Kudo to say thank to developer.
Also Press the Accept as solution Button when u got the Solution.
09-14-2010 10:05 AM
Hi trainee,
this code is working fine for me:
HelpString1 = "";
PIM pim = PIM.getInstance();
ContactList contacts;
contacts = (ContactList) pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY);
Enumeration items;
items = contacts.items();
while(items.hasMoreElements())
{
Contact contact = (Contact) items.nextElement();
if (contacts.isSupportedField(contact.EMAIL))
{
if (contact.countValues(contact.EMAIL) > 0) {
String nname = contact.getString(contact.EMAIL, 0);
HelpString1 = "";
}
}
}
Hoping it will help.
cu
michael
09-14-2010 11:43 AM
thankx nitin and michaelk1.
I have already got the solution.