I am having a problem viewing a contact in my app when I know the ID
(because we just queried and stored it).

I see some comments that a "LOOKUP_URI" is required but I don't know
how to use it and no matter what, I get "The contact does not exist"
even though I know with 100% certainty that it does.

Can someone explain based on the following code snippet:

String name = ContactNameList.get(position);
String strID = ContactIDList.get(position);
Uri contactUri = ContactsContract.Contacts.getLookupUri(Long.parseLong
(strID), "name='"+name + "'");
Intent intent = new Intent(Intent.ACTION_VIEW,contactUri);
                                startActivity(intent);

I am finding that ID = 676 for example and that is getting parsed
correctly and also that name='Joe Smith' does not throw an error but
my activity does not open the contact - I only get the message "The
contact does not exist" in a toast.

Please help!  Thanks very much!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to