Lingua

ContactsPickerSessionContract.ExtraPickContactsRequestedDataFields Field

Definition

A List<String> extra that specifies the types of contact data the client application is requesting.

[Android.Runtime.Register("EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS", ApiSince=37)]
public const string ExtraPickContactsRequestedDataFields;
[<Android.Runtime.Register("EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS", ApiSince=37)>]
val mutable ExtraPickContactsRequestedDataFields : string

Field Value

Attributes

Remarks

A List<String> extra that specifies the types of contact data the client application is requesting. This extra serves two primary purposes: **Filtering:** Only contacts possessing data corresponding to at least one of the specified MIME types will be displayed in the Contacts Picker; **Data Return:** For selected contacts, only data corresponding to these specified MIME types will be returned to the calling application This extra must be populated with one or more of the following MIME types:; ContactsContract.CommonDataKinds.StructuredName.CONTENT_ITEM_TYPE; ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE; ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE; ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE; ContactsContract.CommonDataKinds.Organization.CONTENT_ITEM_TYPE; ContactsContract.CommonDataKinds.Relation.CONTENT_ITEM_TYPE; ContactsContract.CommonDataKinds.Event.CONTENT_ITEM_TYPE; ContactsContract.CommonDataKinds.Photo.CONTENT_ITEM_TYPE; ContactsContract.CommonDataKinds.GroupMembership.CONTENT_ITEM_TYPE; ContactsContract.CommonDataKinds.Website.CONTENT_ITEM_TYPE; ContactsContract.CommonDataKinds.Nickname.CONTENT_ITEM_TYPE

If EXTRA_PICK_CONTACTS_MATCH_ALL_DATA_FIELDS is set to true, only contacts having data corresponding to *all* of the MIME types specified in this extra will be displayed.

The Contacts Picker will throw an IllegalArgumentException if any of the MIME types provided in this extra are not among the allowed types listed above.

Clients are required to set this extra to ensure the picker can determine which information should be made available for selection.

List<String> requestedMimeTypes = new ArrayList<>();
requestedMimeTypes.add(ContactsContract.CommonDataKinds.Email.CONTENT_ITEM_TYPE);
requestedMimeTypes.add(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
intent.putStringArrayListExtra(
        ContactsPickerSessionContract.EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS,
        (ArrayList<String>) requestedMimeTypes);

Android reference for android.provider.ContactsPickerSessionContract.EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to