Detect change in contacts?

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
jassing
Posts: 94
Joined: 16 Jul 2017 01:42
Location: SF Bay Area

Detect change in contacts?

Post by jassing » 14 Dec 2019 18:08

Is there a way to detect a change to the contacts database?

I have a flow that shows a list of contacts with mobile numbers, but it takes 30 seconds to run the load portion. I want to cache the list, and reload only when needed.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Detect change in contacts?

Post by Desmanto » 14 Dec 2019 19:08

So far I can't find the broadcast intent after contact has been changed. But at least at the logcat, there are some lines indicating the contact has been changed. It is still not a good solution to log all the time just for contact.

How often do you change the contact info? And how critical it is to be updated to the most recent ones? Maybe just set a interval to reload the contact everyday. Or you can use app task ended for the contact and add a prompt whether you want to reload the list.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
jassing
Posts: 94
Joined: 16 Jul 2017 01:42
Location: SF Bay Area

Re: Detect change in contacts?

Post by jassing » 14 Dec 2019 19:15

Found it... Content provider change. Luckily it was one of the pre-fill options.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Detect change in contacts?

Post by Desmanto » 14 Dec 2019 19:19

Oh yeah. I missed it. I almost never use it. :)
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply