如何将联系人组添加到联系人管理器示例应用程序中?
我正在从 Android SDK 运行 Contact Manager 示例应用程序。当我将联系人添加到 Gmail 帐户时,它会被添加为“隐形联系人”。我假设这是因为我没有告诉联系人应该将其分配到哪个“组”。我在网上查了几天,却空手而归。
我真正想做的是将联系人添加到我选择的联系人帐户中,并将该联系人与所选 Gmail 帐户中的联系人组相关联,以便该联系人的信息将显示在用户的联系人中。
I am running the Contact Manager sample app from the Android SDK. When I add a contact to my Gmail account, it gets added as an 'invisible contact'. I am assuming this is because I am not telling the contact which 'group' it should be assigned to. I have been looking around the internet for a few days and have come up empty handed.
What I really want to do is add the contact to the Contact Account that I select and have the contact associated with a Contact Group within the selected Gmail Account, so the contact's info will be displayed in the user's contacts.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要使其与新的 ContactsContract API 一起使用,您可以将其添加到 ContentProviderOperation 列表中:
To make it work with the new ContactsContract API, you can add this to the ContentProviderOperation list:
您的目标 Android 版本是什么?您当然知道联系人 API 在 2.x 中发生了根本性的变化...
我遇到了隐形联系人的确切问题,但仅在 1.x 上。我发现解决方案是添加到内置的“我的联系人”组:
如果您想添加到特定的用户定义组而不是“我的联系人”,您将需要从
Contacts.Groups
表。What version of Android are you targeting? You are of course aware that the Contacts API changed radically in 2.x...
I hit this exact problem of invisible contacts, but only on 1.x. I found the solution was to add to the built-in "My Contacts" group :
If you want to add to a specific user-defined group rather than My Contacts you will need to fish the right GROUP_ID out of the
Contacts.Groups
table.