Originally Posted by baran_khan
I am trying to fetch the mobile number of the contact from the address book.
When I try following command:
phone= contact.getString(Contact.TEL, Contact.ATTR_FAX);
it works fine and fetch me the fax number of the contact, but when I replace "ATTR_FAX" with "ATTR_MOBILE" am getting null in return. Although I have filled all the values in the address book for the contact.
Any idea bout where I might be wrong????
Ok...here is the code...can anyone plz explain where am I going wrong...i got this code working if I fetch a fax number for the same contact...but will return null if I look for the mobile number instead of the fax...
list = PIM.getInstance().openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY);
Enumeration contactEnum = list.items();
Contact contact = (Contact)contactEnum.nextElement();
intxxx91;xxx93; fieldIds = contact.getFields();
name = contact.getStringArray(contact.NAME, 0);
phone= contact.getString(Contact.TEL, Contact.ATTR_MOBILE);
Thanks in advance!!!