0

I'm using this code to know a contact name, his phone number and his ID

String name = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
String phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
String id = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone._ID));

I need to disover what's the number type(work, home, mobile). How can I do it?

Guilherme Pressutto
  • 785
  • 2
  • 6
  • 18

1 Answers1

0

Use Phone.TYPE

 int phoneType = phones.getInt(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE));
Hoan Nguyen
  • 18,033
  • 3
  • 50
  • 54