Please tell me, though, how do you create a lookup key? Can you give or point me to a good example?
On Jan 31, 12:47 pm, Dmitri Plotnikov (▯▯▯▯) <[email protected]> wrote: > Contact IDs are volatile, they often change as a result of aggregation. You > need to store the lookup key rather than the id of a contact if you want a > more stable reference. > > Cheers, > Dmitri > > On Jan 31, 2010 9:42 AM, "andrew android" <[email protected]> wrote: > > 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 [email protected] > To unsubscribe from this group, send email to > [email protected]<android-developers%2Bunsubs > [email protected]> > For more options, visit this group > athttp://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

