1

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?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Tregi
  • 19
  • 2

1 Answers1

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.

Community
  • 1
  • 1
FireAphis
  • 6,650
  • 8
  • 42
  • 63