In our android contact list, we are presented with different accounts like- whatsApp, gmail, FB etc. to sync our contact list and linking contacts if they are active with any of those accounts. My problem statement is that when i insert a contact in android contact list by writing code then that newly inserted contact should get synced with WhatsApp so that we can be sure whether that contact is available with WhatsApp or not. If contact is available with WhatsApp when sync is run, then it gets linked with that.
在我们的安卓联系人列表中,我们会看到不同的帐户,如whatsApp,gmail,FB等,以同步我们的联系人列表并链接联系人,如果他们在任何这些帐户中处于活动状态。我的问题陈述是,当我通过编写代码在android联系人列表中插入联系人时,新插入的联系人应该与WhatsApp同步,以便我们可以确定该联系人是否可用于WhatsApp。如果在运行同步时WhatsApp可以联系,那么它将与之链接。
WhatsApp has its Sync Adapter which get invoked periodically to sync with contacts in android contact list. But, in my case i want to get invoked that sync adapter as soon as i insert a new contact in android contact list with my code.
WhatsApp有其同步适配器,可定期调用以与android联系人列表中的联系人同步。但是,在我的情况下,我想在我的代码中插入android联系人列表中的新联系人后立即调用同步适配器。
So, if anybody can help me here to invoke this synchronization process for newly inserted contact then it would be a great help.
所以,如果有人可以帮我在这里为新插入的联系人调用这个同步过程那么这将是一个很大的帮助。
Also, if anyone can suggest me some other way to make sure whether a contact is available on whatsapp or not then it will also be helpful.
此外,如果任何人都可以建议我一些其他方式来确定whatsapp上是否有联系人,那么它也会有所帮助。
Thanks in advance.
提前致谢。
1 个解决方案
#1
2
Here you go, how to listen for changes in Contact Database The only thing you can do is to register a content observer.If whatsapp sync adapter works on this technique then you are good to Go.Please accept the answer if it works for you!
在这里,你去,如何监听联系人数据库的变化你唯一能做的就是注册一个内容观察者。如果whatsapp同步适配器适用于这种技术,那么你很高兴Go.Please接受答案,如果它适合你!
#1
2
Here you go, how to listen for changes in Contact Database The only thing you can do is to register a content observer.If whatsapp sync adapter works on this technique then you are good to Go.Please accept the answer if it works for you!
在这里,你去,如何监听联系人数据库的变化你唯一能做的就是注册一个内容观察者。如果whatsapp同步适配器适用于这种技术,那么你很高兴Go.Please接受答案,如果它适合你!