I'm trying to launch add contact activity from my application. I've known how to call contact activity, but still unknown how to launch "Add Contact". I'm a beginner learning Android, please be specific. Thank you.
Intent intent = new Intent(
ContactsContract.Intents.SHOW_OR_CREATE_CONTACT,
Uri.parse("tel:" + phoneNumber));
intent.putExtra(ContactsContract.Intents.EXTRA_FORCE_CREATE, true);
startActivity(intent);
Try this code:
Intent i = new Intent(Intent.ACTION_INSERT_OR_EDIT);
i.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
startActivity(i);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With