my app uses the contacts of the android device. For better performance the contacts are put into a cache. At the moment i refresh the cache after X minutes, in my eyes no perfect solution. Is there any way to receive an Intent via BroadcastReceiver when there is any change (create update delete) on the contact database?
Asked
Active
Viewed 150 times
1 Answers
0
You cannot receive an intent after a contact was changed. It is impossible because the framework doesn't send any intents for these events. You can get an intent for when a user requests to add a contact; e.g., when a user clicks "+" button in the contacts app. But as I understand that is not what you need.
The only way I know to get notified when a new contact is added, is to register a content observer. You will probably want to create a background service that registers itself as a content observer.
Here is a helpful question discussing content observers.