How can I launch the 'Add Contact' activity in android
API Level 5 and above solution
// Add listener so your activity gets called back upon completion of action,
// in this case with ability to get handle to newly added contact
myActivity.addActivityListener(someActivityListener);
Intent intent = new Intent(Intent.ACTION_INSERT);
intent.setType(ContactsContract.Contacts.CONTENT_TYPE);
// Just two examples of information you can send to pre-fill out data for the
// user. See android.provider.ContactsContract.Intents.Insert for the complete
// list.
intent.putExtra(ContactsContract.Intents.Insert.NAME, "some Contact Name");
intent.putExtra(ContactsContract.Intents.Insert.PHONE, "some Phone Number");
// Send with it a unique request code, so when you get called back, you can
// check to make sure it is from the intent you launched (ideally should be
// some public static final so receiver can check against it)
int PICK_CONTACT = 100;
myActivity.startActivityForResult(intent, PICK_CONTACT);
These two lines do the trick:
Intent intent = new Intent(Intent.ACTION_INSERT,
ContactsContract.Contacts.CONTENT_URI);
startActivity(intent);
This should be the snippet your are looking for:
Intent addContactIntent = new Intent(Contacts.Intents.Insert.ACTION, Contacts.People.CONTENT_URI);
addContactIntent.putExtra(Contacts.Intents.Insert.NAME, "Jean-Claude"); // an example, there is other data available
startActivity(addContactIntent)
This post may help you out or at least point you in the right direction.
Hope this helps.
Update 05/11/2015:
Per the comments, check out vickey's answer below for the appropriate solution.
If you have a phone no and want to save it in your own application then use this code it will move you to the "create contact" page of the default contact app.
Intent addContactIntent = new Intent(Intent.ACTION_INSERT);
addContactIntent.setType(ContactsContract.Contacts.CONTENT_TYPE);
addContactIntent.putExtra(ContactsContract.Intents.Insert.PHONE,phnno.getText().toString());
startActivity(addContactIntent);