有意图的Android联系信息更新? [英] Android contact info update with intent?

查看:149
本文介绍了有意图的Android联系信息更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过使用putExtra将信息作为额外数据传递来创建与Intent的新联系,是否可以使用信息创建Intent,如果联系人已经在电话簿中,它将使用新信息进行更新?

I can create new contact with Intent by passing info as extra data with putExtra, is it possible to create Intent with info and if contact is already in phonebook it will be update with new info?

推荐答案

实际上,您可以使用意图来创建与ContactsContract的新联系人,并且不会弃用它。

Actually you can use intents to create new contacts with ContactsContract and it's not deprecated.

http://developer.android.com/reference/android/provider/ContactsContract.Intents.Insert。 html

适用于我的示例:

Intent i = new Intent(Intent.ACTION_INSERT_OR_EDIT);
i.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
i.putExtra(Insert.NAME, "TESTTEST");
i.putExtra(Insert.PHONE, "209384");
startActivity(i);

这篇关于有意图的Android联系信息更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆