Android with contact information?

I can create a new contact with Intent, transferring information as additional data using putExtra, is it possible to create an Intent with information, and if the contact is already in the phone book, will it be updated with new information?

+3
source share
2 answers

In fact, you can use intentions to create new contacts with ContactsContract and not become obsolete.

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

an 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);
+12
source

Android 2.0. ContactsContract.

docs .

+1

Source: https://habr.com/ru/post/1774810/


All Articles