How to know which specific contact was updated in android?

后端 未结 2 2058
遇见更好的自我
遇见更好的自我 2021-01-03 02:08

I am able to get a generic notification \"that there was a change to the contacts DB\", but I want to know the specific record that was inserted, updated, or deleted.

2条回答
  •  一生所求
    2021-01-03 02:38

    I implemented this problem in the following way:

    During the installation of an app my local DB's Contact table is being initialized by the contacts of the given time. Then all the calls are being tracked by a CallListner : if user gets/makes calls I check if the number is in the current Phone Book of a user,if so I retrieve all contact information related to that number and update my local DB.

提交回复
热议问题