如何在 Android 中为联系人创建帐户?
我正在创建一个管理设备电话簿的应用程序。
在手机中,有诸如 com.google 或 com.htc.android.pcsc 之类的联系人帐户。 当用户添加新联系人时,该联系人将被分配到一个帐户。
我如何创建这样的帐户?我对联系人帐户的工作方式很不熟悉。如果可能的话,我想知道我应该在哪里寻找这些信息。
谢谢大家!
I'm creating an app that manages the phonebook of the device.
In the phone, there are contact accounts like com.google or com.htc.android.pcsc.
When the user adds a new contact, the contact will be assigned to an account.
How do I create such an account? I'm quite unfamiliar with how the contacts account work. I would like to have a few pointers on where I should be looking this information for, if possible.
Thanks everyone!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果有人要创建这个自定义帐户。您必须使用 accountManagers 创建其中之一。这意味着您必须以某种方式编写自己的同步适配器和类似的东西,以便让 Android 将您识别为帐户之一。
但是,存在一个错误,限制编辑来自此自定义帐户的联系人。
因此,我不会在我的应用程序中实现此功能。
If anyone were to create this custom accounts. You will have to create one of this using the accountManagers. That means somehow you have to write your own syncadapters and stuff like that in order to let Android recognise you as one of the accounts.
However there's a bug that restrict editing of contacts that are from this custom accounts.
Therefore, i'm not going to implement this feature in my app.