0

I was wondering is there is a way of parsing a contact details (number,email etc.) by a specific uri address which received by the contact list

example: //assume that the data variable ia already populated with a uri address of a specific contact which was picked up from the contact list

Uri contact = contact = data.getData();

how could I acutely parse the contact details by it's number, email, organisation and so on..?

thanks,

ray.

rayman
  • 20,786
  • 45
  • 148
  • 246

1 Answers1

0

For Email you can use

// query for everything email
            cursor = getContentResolver().query(Email.CONTENT_URI, null,
                    Email.CONTACT_ID + "=?", new String[] { id }, null);

            int emailIdx = cursor.getColumnIndex(Email.DATA);

            // let's just get the first email
            if (cursor.moveToFirst()) {
             String email = cursor.getString(emailIdx);
            }

Change Email with Phone you'll get contact no.

Walid Hossain
  • 2,724
  • 2
  • 28
  • 39