Girish Gupta
Girish Gupta

Reputation: 11

Sync newly inserted contact in android contact list with Whatsapp to get linked

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 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.

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.

Thanks in advance.

Upvotes: 1

Views: 3112

Answers (1)

kairon007
kairon007

Reputation: 21

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!

Upvotes: 2

Related Questions