android get contact phone number
- by ng93
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