Android.Provider.ContactsContract.Intents.Insert.Data Field
The extra field that allows the client to supply multiple rows of arbitrary data for a single contact created using the Android.Content.Intent.ActionInsert or edited using Android.Content.Intent.ActionEdit.

Syntax

[Android.Runtime.Register("DATA")]
public const string Data

Remarks

The extra field that allows the client to supply multiple rows of arbitrary data for a single contact created using the Android.Content.Intent.ActionInsert or edited using Android.Content.Intent.ActionEdit. It is an ArrayList of Android.Content.ContentValues, one per data row. Supplying this extra is similar to inserting multiple rows into the Android.Provider.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 Android.Provider.ContactsContract.DataColumns.Mimetype. If supplied values are not visible in the editor UI, they will be dropped. Duplicate data will dropped. Some fields like Android.Provider.ContactsContract.CommonDataKinds.CommonColumns.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:

java 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, "android@android.com");
  data.add(row2);

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

  startActivity(intent);
 

[Android Documentation]

Requirements

Namespace: Android.Provider
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 11