android get contact phone number
Posted
by ng93
on Stack Overflow
See other posts from Stack Overflow
or by ng93
Published on 2010-06-13T12:23:45Z
Indexed on
2010/06/13
12:32 UTC
Read the original article
Hit count: 339
hi,
im trying to get a contacts name and phone number from the contacts list. im using:
contactname = Curser.getString(Curser.getColumnIndex(Contacts.DISPLAY_NAME));
to get their name and it works fine. But using:
contactphone = Curser.getString(Curser.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
causes no warnings or errors and builds fine, yet force closes in both the emulator (2.1) and my htc desire (nexus one 2.2 rom/htc desire 2.1 rom). Any ideas how to fix it?
oh and contactname and contactphone are both strings
thanks, ng93
© Stack Overflow or respective owner