Reacting to new contacts in Android Contacts application

孤街醉人 提交于 2019-12-05 00:57:02

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/1011111/reacting-to-new-contacts-in-android-contacts-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!