有没有办法将对象分配给联系人,android

发布于 2024-12-10 00:44:04 字数 183 浏览 3 评论 0原文

我知道如何从 android 的本机联系人列表中检索、编辑或删除联系人。我对每个联系人都有特定的任务。我希望当我单击联系人时我想知道分配给该对象的任务是什么。有没有办法将任何对象分配给任何联系人。就像我们为按钮或 ImageView 所做的 setTag() 和 get Tag() 一样。 我没有找到任何方法将对象分配给联系人。

谢谢

I know how to retrieve, edit, or delet a contact from native contact list in android. I have certain task for each contact. I want when i click on the contact I want to know what is the task assigned to the object. Is there any way to assign any object to any contact. like we do setTag() and get Tag() for buttons or ImageView.
I didnt find any way to assign the object to the contact.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风为裳 2024-12-17 00:44:04

您无法将普通对象分配给联系人,但可以设置自定义数据字段。这是通过创建新的 Mime 类型来完成的。查看此答案以了解具体信息:如何在 android 2.0 的联系人中添加自定义数据/字段?

创建自定义 Mime 类型后,您可以添加和检索与此类型关联的任何数据您的联系人。

You can't assign a plain object to a Contact but you can set custom data fields. This is done by creating a new Mime Type. Check out this answer for the specifics: How to add custom data/field in contacts in android 2.0?

Once you've created you're custom Mime Type, you can add and retrieve data associated with this type for any of your contacts.

北渚 2024-12-17 00:44:04

您可以将任何数据存储在自己的数据库中,并使用查找键作为联系人数据库的外键。

And you can store any data in own database and use the LOOKUP KEY as foreign key to contacts database.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文