0

I'm looking for a way to get notified when a new contact is added (or changed) in the device db.

From looking in the documentation it looks like there are a lot of intents used to start activities that add contacts or attach photos but there isn't an intent fired when something is changed in the contacts tables.

Any kind of notification can help, preferably an intent.

Thanks

Guy B.
  • 611
  • 5
  • 10
  • possible duplicate of [Broadcast on contact add/change?](http://stackoverflow.com/questions/5733775/broadcast-on-contact-add-change) – Kurtis Nusbaum Nov 08 '11 at 15:30
  • Thanks @KurtisNusbaum It is indeed the same. I missed it when I searched for similar ones. The method ContentResolver.registerContentObserver can be used to achieve what I wanted. – Guy B. Nov 28 '11 at 20:24

1 Answers1

0

There is not an Intent fired, as far as I know, since the DB is an SQLite DB.

What you might be able to do is manage a custom CursorAdapter and manipulate OnDataSetChanged. This should tell you when your data set is changed, but you will need to be very careful in order to avoid database deadlock.

I might be able to give a better answer if you describe the problem you are trying to solve in more detail!

Hope this helps.

Codeman
  • 12,157
  • 10
  • 53
  • 91
  • Thanks @Phenoixblade9 but this isn't what I was looking for. See my comment at the top for reference to a solution suggested in a different question. – Guy B. Nov 28 '11 at 20:30