Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public static final class

ContactsContract.Intents.Insert

extends Object
java.lang.Object
   ↳ android.provider.ContactsContract.Intents.Insert

Class Overview

Convenience class that contains string constants used to create contact Intents .

Summary

Constants
String ACTION The action code to use when adding a contact
String COMPANY The extra field for the contact company.
String DATA The extra field that allows the client to supply multiple rows of arbitrary data for a single contact created using the ACTION_INSERT or edited using ACTION_EDIT .
String EMAIL The extra field for the contact email address.
String EMAIL_ISPRIMARY The extra field for the email isprimary flag.
String EMAIL_TYPE The extra field for the contact email type.
String FULL_MODE If present, forces a bypass of quick insert mode.
String IM_HANDLE The extra field for an IM handle.
String IM_ISPRIMARY The extra field for the IM isprimary flag.
String IM_PROTOCOL The extra field for the IM protocol
String JOB_TITLE The extra field for the contact job title.
String NAME The extra field for the contact name.
String NOTES The extra field for the contact notes.
String PHONE The extra field for the contact phone number.
String PHONETIC_NAME The extra field for the contact phonetic name.
String PHONE_ISPRIMARY The extra field for the phone isprimary flag.
String PHONE_TYPE The extra field for the contact phone number type.
String POSTAL The extra field for the contact postal address.
String POSTAL_ISPRIMARY The extra field for the postal isprimary flag.
String POSTAL_TYPE The extra field for the contact postal address type.
String SECONDARY_EMAIL The extra field for an optional second contact email address.
String SECONDARY_EMAIL_TYPE The extra field for an optional second contact email type.
String SECONDARY_PHONE The extra field for an optional second contact phone number.
String SECONDARY_PHONE_TYPE The extra field for an optional second contact phone number type.
String TERTIARY_EMAIL The extra field for an optional third contact email address.
String TERTIARY_EMAIL_TYPE The extra field for an optional third contact email type.
String TERTIARY_PHONE The extra field for an optional third contact phone number.
String TERTIARY_PHONE_TYPE The extra field for an optional third contact phone number type.
Public Constructors
ContactsContract.Intents.Insert ()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ACTION

Added in API level 5

The action code to use when adding a contact

Constant Value: "android.intent.action.INSERT"

public static final String COMPANY

Added in API level 5

The extra field for the contact company.

Type: String

Constant Value: "company"

public static final String DATA

The extra field that allows the client to supply multiple rows of arbitrary data for a single contact created using the ACTION_INSERT or edited using ACTION_EDIT . It is an ArrayList of ContentValues , one per data row. Supplying this extra is similar to inserting multiple rows into the ContactsContract.Contacts.Data table, except the user gets a chance to see and edit them before saving. Each ContentValues object must have a value for MIMETYPE . If supplied values are not visible in the editor UI, they will be dropped. Duplicate data will dropped. Some fields like Email.TYPE may be automatically adjusted to comply with the constraints of the specific account type. For example, an Exchange contact can only have one phone numbers of type Home, so the contact editor may choose a different type for this phone number to avoid dropping the valueable part of the row, which is the phone number.

Example:

          ArrayList<ContentValues> data = new ArrayList<ContentValues>();

  ContentValues row1 = new ContentValues();
  row1.put(Data.MIMETYPE, Organization.CONTENT_ITEM_TYPE);
  row1.put(Organization.COMPANY, "Android");
  data.add(row1);

  ContentValues row2 = new ContentValues();
  row2.put(Data.MIMETYPE, Email.CONTENT_ITEM_TYPE);
  row2.put(Email.TYPE, Email.TYPE_CUSTOM);
  row2.put(Email.LABEL, "Green Bot");
  row2.put(Email.ADDRESS, "[email protected]");
  data.add(row2);

  Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
  intent.putParcelableArrayListExtra(Insert.DATA, data);

  startActivity(intent);
         

Constant Value: "data"

public static final String EMAIL

Added in API level 5

The extra field for the contact email address.

Type: String

Constant Value: "email"

public static final String EMAIL_ISPRIMARY

Added in API level 5

The extra field for the email isprimary flag.

Type: boolean

Constant Value: "email_isprimary"

public static final String EMAIL_TYPE

Added in API level 5

The extra field for the contact email type.

Type: Either an integer value from ContactsContract.CommonDataKinds.Email or a string specifying a custom label.

Constant Value: "email_type"

public static final String FULL_MODE

Added in API level 5

If present, forces a bypass of quick insert mode.

Constant Value: "full_mode"

public static final String IM_HANDLE

Added in API level 5

The extra field for an IM handle.

Type: String

Constant Value: "im_handle"

public static final String IM_ISPRIMARY

Added in API level 5

The extra field for the IM isprimary flag.

Type: boolean

Constant Value: "im_isprimary"

public static final String IM_PROTOCOL

Added in API level 5

The extra field for the IM protocol

Constant Value: "im_protocol"

public static final String JOB_TITLE

Added in API level 5

The extra field for the contact job title.

Type: String

Constant Value: "job_title"

public static final String NAME

Added in API level 5

The extra field for the contact name.

Type: String

Constant Value: "name"

public static final String NOTES

Added in API level 5

The extra field for the contact notes.

Type: String

Constant Value: "notes"

public static final String PHONE

Added in API level 5

The extra field for the contact phone number.

Type: String

Constant Value: "phone"

public static final String PHONETIC_NAME

Added in API level 5

The extra field for the contact phonetic name.

Type: String

Constant Value: "phonetic_name"

public static final String PHONE_ISPRIMARY

Added in API level 5

The extra field for the phone isprimary flag.

Type: boolean

Constant Value: "phone_isprimary"

public static final String PHONE_TYPE

Added in API level 5

The extra field for the contact phone number type.

Type: Either an integer value from ContactsContract.CommonDataKinds.Phone , or a string specifying a custom label.

Constant Value: "phone_type"

public static final String POSTAL

Added in API level 5

The extra field for the contact postal address.

Type: String

Constant Value: "postal"

public static final String POSTAL_ISPRIMARY

Added in API level 5

The extra field for the postal isprimary flag.

Type: boolean

Constant Value: "postal_isprimary"

public static final String POSTAL_TYPE

Added in API level 5

The extra field for the contact postal address type.

Type: Either an integer value from ContactsContract.CommonDataKinds.StructuredPostal or a string specifying a custom label.

Constant Value: "postal_type"

public static final String SECONDARY_EMAIL

Added in API level 5

The extra field for an optional second contact email address.

Type: String

Constant Value: "secondary_email"

public static final String SECONDARY_EMAIL_TYPE

Added in API level 5

The extra field for an optional second contact email type.

Type: Either an integer value from ContactsContract.CommonDataKinds.Email or a string specifying a custom label.

Constant Value: "secondary_email_type"

public static final String SECONDARY_PHONE

Added in API level 5

The extra field for an optional second contact phone number.

Type: String

Constant Value: "secondary_phone"

public static final String SECONDARY_PHONE_TYPE

Added in API level 5

The extra field for an optional second contact phone number type.

Type: Either an integer value from ContactsContract.CommonDataKinds.Phone , or a string specifying a custom label.

Constant Value: "secondary_phone_type"

public static final String TERTIARY_EMAIL

Added in API level 5

The extra field for an optional third contact email address.

Type: String

Constant Value: "tertiary_email"

public static final String TERTIARY_EMAIL_TYPE

Added in API level 5

The extra field for an optional third contact email type.

Type: Either an integer value from ContactsContract.CommonDataKinds.Email or a string specifying a custom label.

Constant Value: "tertiary_email_type"

public static final String TERTIARY_PHONE

Added in API level 5

The extra field for an optional third contact phone number.

Type: String

Constant Value: "tertiary_phone"

public static final String TERTIARY_PHONE_TYPE

Added in API level 5

The extra field for an optional third contact phone number type.

Type: Either an integer value from ContactsContract.CommonDataKinds.Phone , or a string specifying a custom label.

Constant Value: "tertiary_phone_type"

Public Constructors

public ContactsContract.Intents.Insert ()

Added in API level 5