Originally Posted by PaoloLim
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.
Sorry for not replying you this long...was on holiday...u know what it actually works...but I am not really satisfied with the way they are dealing with this....instead of doing it this way..they should have maintained the index names associated with the values that are being stored...instead of having it changed every time we make a change in the contacts...but I guess this is for saving the memory...
Thanks for ur support..i ll look forward for such responses and hope we can share a bag full of knowledge in future.....