Android: Manage contacts with lookup key

后端 未结 2 707
旧时难觅i
旧时难觅i 2020-12-09 05:49

I\'m currently writing a application that allows to save drafts (using android version >= 2.0). Each draft is connected to a contact via the ContactsContract.Contacts.

2条回答
  •  孤城傲影
    2020-12-09 06:48

    It is my understanding that the lookup key is a structured / hierarchical key. Hence strictly speaking it can change, but still be used to find your contact back, by using the appropriate method:

        Uri lookupUri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, lookupKey);
        Uri res = ContactsContract.Contacts.lookupContact(getContentResolver(), lookupUri);
    

提交回复
热议问题