View Single Post
Old 07-28-2008, 02:03 PM   #3 (permalink)
New Member
Join Date: Jun 2008
Model: 7290
Carrier: Cingular
Posts: 14
Post Thanks: 0
Thanked 0 Times in 0 Posts

The attribute constant isn't the same as the index number. I'm assuming you're getting an arrayindexoutofbounds exception or nullreference exception. Best way I can think of is to do something like:

for(int y=0; y < contact.countValues(Contact.TEL); y++)
    if(contact.getAttributes(Contact.TEL, y) == Contact.ATTR_MOBILE)
        phone = contact.getString(Contact.TEL, y);  
The reason the fax attribute constant is working is that it happens to be low enough to be an actual index.

EDIT: Sorry, that's a lowercase c on contact.getAttributes.

Last edited by PaoloLim : 07-28-2008 at 02:06 PM.
Offline   Reply With Quote