I am using this code snippet to retrieve contact’s email addressees but what I want to do is list the contacts who has got email address. With this method it displays all of the contacts
try {
list = (BlackBerryContactList) PIM.getInstance()
.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY);
PIMItem contact = list.choose();
if (contact != null) {
String emailId = "";
for (int i = 0; i < contact.countValues(Contact.EMAIL); i++) {
emailId = contact.getString(Contact.EMAIL, i);
System.out.println("_ _ _ _ __ EMAIL : " + i + " " + emailId);
}
}
} catch (PIMException e) {
Dialog.inform("Proble creating contact list!");
e.printStackTrace();
}
Find below the function which return only those contact list which contains email address: