响应Android联系人应用程序中的新联系人

时间:2022-05-25 00:21:05

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.

每当用户在Android Contacts应用程序中添加新联系人时,我都想执行某项操作。它将包括使用新联系人的信息。

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 个解决方案

#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.

看起来您最好的做法是运行一个轻量级的后台服务,该服务使用联系人数据的内容观察者,因为在输入新联系人时没有公开广播的意图。关于这个想法的更详细的讨论可以在android-developers google group网站上找到。

#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.

看起来您最好的做法是运行一个轻量级的后台服务,该服务使用联系人数据的内容观察者,因为在输入新联系人时没有公开广播的意图。关于这个想法的更详细的讨论可以在android-developers google group网站上找到。