tags:

views:

39

answers:

1

How can I query Android contact (in android 2.1) based on a phone number?

I used to use People.CONTENT_URI (before android 2.1) but that is now deprecated.

Thank you.

A: 

Quick way to lookup a contact using just the phone number. This is how the caller ID does it.

Uri uri = Uri.withAppendedPath(
    PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
managedQuery(uri, new String[]{PhoneLookup.DISPLAY_NAME,...
BrennaSoft
Where can I find code? I would like to know what is the '...' in the above code?Thank you.
michael
That's just an example.managedQuery(uri, new String[]{PhoneLookup.DISPLAY_NAME}, null, null, null, null);would only return the display name.
BrennaSoft