there must something u r doing in wrong manner... i've tried the same thing and it is working correctly on my end...
following are the code snippets i've used
for JDE 4.3
Code:
BlackBerryContactList contacts = (BlackBerryContactList)BlackBerryPIM.getInstance().openPIMList(BlackBerryPIM.CONTACT_LIST, BlackBerryPIM.READ_WRITE);
BlackBerryContact contact = (BlackBerryContact)contacts.choose();
if(contact!=null){
int numValues = 0;
numValues = contact.countValues(BlackBerryContact.TEL);
for (int i = 0; i < numValues; i++) {
if (contact.getAttributes(BlackBerryContact.TEL, i) == BlackBerryContact.ATTR_MOBILE) {
mobileNumber = contact.getString(BlackBerryContact.TEL, i);
break;
}
}
}
for JDE 4.2
Code:
BlackBerryContactList contacts = (BlackBerryContactList)PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
BlackBerryContact contact = (BlackBerryContact)contacts.choose(null,BlackBerryContactList.AddressTypes.PIN,true);
if(contact!=null){
int numValues = 0;
numValues = contact.countValues(BlackBerryContact.TEL);
for (int i = 0; i < numValues; i++) {
if (contact.getAttributes(BlackBerryContact.TEL, i) == BlackBerryContact.ATTR_MOBILE) {
mobileNumber = contact.getString(BlackBerryContact.TEL, i);
break;
}
}
}
Hope it will help u..