Friday, November 9, 2012

Android Add Contact to your Phone

Here is a sample code for adding contact to android phone


Intent intent = new Intent(Intent.ACTION_INSERT);

intent.setType(ContactsContract.Contacts.CONTENT_TYPE);

intent.putExtra(ContactsContract.Intents.Insert.NAME, contactname);
intent.putExtra(ContactsContract.Intents.Insert.PHONE, mobilenumber);

intent.putExtra(ContactsContract.Intents.Insert.EMAIL, email);

intent.putExtra(ContactsContract.Intents.Insert.POSTAL, address);

startActivity(intent);

No comments:

Post a Comment