views:

855

answers:

1

I would like to perform a certain operation every time a user adds a new contact in the Android Contacts application. It would include using the new contact's information.

Is there an easy way to do this? Is there some event that can be listened for or do I have to extend the Contacts application itself? Or should I just think of some other approach if this is not feasible.

+4  A: 

It looks like your best course of action on this is to run a lightweight background service that uses a content observer for the contacts data because there is no intent that is publicly broadcasted when a new contact is entered. A much more detailed discussion of this idea can be found on the android-developers google group site.

snctln
Using this method you should keep in mind the following: - ContentObservers are only notified on a *change* to the data set they are observing. They are not told what the change actually was. So if you're trying to react to new contacts you need to do something like check the most recently added contact and compare it to the contact that you just reacted to.
Anson MacKeracher