View Single Post
Old 07-28-2008, 04:40 AM   #2 (permalink)
baran_khan
Thumbs Must Hurt
 
baran_khan's Avatar
 
Join Date: Apr 2008
Model: 9500
PIN: N/A
Carrier: Airtel
Posts: 110
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by baran_khan View Post
HI,

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...

PHP Code:
                    list = PIM.getInstance().openPIMList(PIM.CONTACT_LISTPIM.READ_ONLY);

                    
Enumeration contactEnum = list.items();


                    while(
contactEnum.hasMoreElements()){
                        
                        
temps++;
                        
Contact contact = (Contact)contactEnum.nextElement();
                        
intxxx91;xxx93; fieldIds contact.getFields();
                        
int id;
                        
name contact.getStringArray(contact.NAME0);
                        
phonecontact.getString(Contact.TELContact.ATTR_MOBILE);
                        
                    } 
Thanks in advance!!!
__________________
Smart People ask for Help!!!
Offline   Reply With Quote