Reputation: 819
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.
Upvotes: 4
Views: 5345
Reputation: 3703
Try this code:
Intent i = new Intent(Intent.ACTION_INSERT_OR_EDIT);
i.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
startActivity(i);
Upvotes: 2
Reputation: 4580
Intent intent = new Intent(
ContactsContract.Intents.SHOW_OR_CREATE_CONTACT,
Uri.parse("tel:" + phoneNumber));
intent.putExtra(ContactsContract.Intents.EXTRA_FORCE_CREATE, true);
startActivity(intent);
Upvotes: 10