Language

ContactsPickerSessionContract.ExtraPickContactsRequestedDataFields Field

Definition

The key for an intent extra containing the requested contact-data MIME types.

[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

The picker displays contacts with data for at least one requested MIME type and returns only data for the requested types. Supply one or more of these MIME types:

If ExtraPickContactsMatchAllDataFields is true, only contacts with data for all requested MIME types are displayed.

The picker throws IllegalArgumentException if a requested MIME type is not in this list.

Clients must set this extra so that the picker can determine which information to make available. Use PutStringArrayListExtra(String, IList<String>) to supply the list.

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