Android: Manage contacts with lookup key

江枫思渺然 提交于 2019-12-02 17:35:37

问题


Following up on this question:

Android: Manage contacts with lookup key

(see below)

I have the same problem. However, it shows with Android 2.1 Update 1, But is OK with Android 2.2.

It seems that the lookup key changes with contact's name change with Android 2.1, but does not change with Android 2.2.

Did anybody else experience this? Any suggested workaround for Android 2.1?

Thanks

Original question by chromate

Hi everybody,

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.LOOKUP_KEY. My problem is that if I change the name of my contact the lookup key changes also. Is that the way this works?

So for what do I need a lookup key? I thought that the lookup key does never change and now it changes anyway. I'm confused about that behavior ...

Can someone explain to me how to link permanently to a contact? Should I use IDs instead of the lookup key?

Thanks in advance.


回答1:


why don't you find contact id or lookup key via using raw contact id? this is bug in 2.1.

Lookup key was based on the contact name for unsynced contacts.

http://comments.gmane.org/gmane.comp.handhelds.android.devel/130677




回答2:


You can use contact ids instead of that. Look up key is not stable. So do not us look up key. And the benefit of contact id is it won't very. So use contact id. good luck



来源:https://stackoverflow.com/questions/3940864/android-manage-contacts-with-lookup-key

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!