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

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:

Code:
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 03:06 PM.
Offline   Reply With Quote