Android contact info update with intent?

ぐ巨炮叔叔 提交于 2019-12-04 16:22:19

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

example that works for me:

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);
Peter Knego

Using Intents to create new contacts is deprecated since Android 2.0. Use ContactsContract.

Here are the docs and an example.

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