0

跟进这个问题:

Android:使用查找键管理联系人

(见下文)

我也有同样的问题。但是,它在 Android 2.1 Update 1 中显示,但在 Android 2.2 中正常。

看起来查找键会随着 Android 2.1 的联系人姓名的变化而变化,但不会随着 Android 2.2 的变化而变化。

有没有其他人经历过这个?Android 2.1 有什么建议的解决方法吗?

谢谢

铬酸盐的原始问题

大家好你们好,

我目前正在编写一个允许保存草稿的应用程序(使用 android 版本 >= 2.0)。每个草稿都通过 ContactsContract.Contacts.LOOKUP_KEY 连接到一个联系人。我的问题是,如果我更改联系人的姓名,查找键也会更改。这是这样的吗?

那么我需要一个查找键来做什么?我认为查找键永远不会改变,现在它无论如何都会改变。我对这种行为感到困惑......

有人可以向我解释如何永久链接到联系人吗?我应该使用 ID 而不是查找键吗?

提前致谢。

4

3 回答 3

2

您可以使用联系人 ID 来代替。查找键不稳定。所以我们不要查关键。联系 id 的好处是它不会很。所以使用联系人ID。祝你好运

于 2012-11-08T10:02:49.727 回答
1

为什么不通过使用原始联系人 ID 找到联系人 ID 或查找键?这是 2.1 中的错误。

查找键基于未同步联系人的联系人姓名。

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

于 2011-04-27T12:18:32.643 回答
0

即使更改了查找键,它仍然会指向同一个联系人。

来自:https ://developer.android.com/guide/topics/providers/contacts-provider

The ContactsContract.Contacts table also has the column LOOKUP_KEY that is a "permanent" link to the contact row. Because the Contacts Provider maintains contacts automatically, it may change a contact row's _ID value in response to an aggregation or sync. Even If this happens, the content URI CONTENT_LOOKUP_URI combined with contact's LOOKUP_KEY will still point to the contact row, so you can use LOOKUP_KEY to maintain links to "favorite" contacts, and so forth. This column has its own format that is unrelated to the format of the _ID column.

于 2020-11-05T10:55:35.547 回答