Android Intent Action “ACTION_INSERT_OR_EDIT” - should it be used for adding contacts?

若如初见. 提交于 2019-12-02 21:30:57

As much of the Android documentation goes, the documentation for native intents is pretty slim, but the available extras are listed here: http://developer.android.com/reference/android/provider/ContactsContract.Intents.Insert.html

Here is an example:

Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
intent.putExtra(ContactsContract.Intents.Insert.EMAIL, "example@example.com");
startActivity(intent);

The code above should start an activity that lets you pick a contact to edit with the "example@example.com" inserted as a new email, or let you create a new contact with "example@example.com" inserted as the email.

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