Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import android.app.Activity
import android.content.ActivityNotFoundException
import android.content.Context
import android.content.Intent
import android.content.Intent.EXTRA_USE_SYSTEM_CONTACTS_PICKER
Comment thread
yrezgui marked this conversation as resolved.
import android.net.Uri
import android.os.Bundle
import android.provider.ContactsContract
Expand Down Expand Up @@ -117,6 +118,7 @@ fun ContactPickerScreen(modifier: Modifier) {

// Set up the intent for the Contact Picker
val pickContactIntent = Intent(ACTION_PICK_CONTACTS).apply {
putExtra(EXTRA_USE_SYSTEM_CONTACTS_PICKER, true)
putStringArrayListExtra(
EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS,
requestedFields
Expand Down Expand Up @@ -144,6 +146,7 @@ fun ContactPickerScreen(modifier: Modifier) {

// Set up the intent for the Contact Picker
val pickContactIntent = Intent(ACTION_PICK_CONTACTS).apply {
putExtra(EXTRA_USE_SYSTEM_CONTACTS_PICKER, true)
// Enable multi-select
putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true)
// Set limit of selectable contacts
Expand Down Expand Up @@ -177,6 +180,7 @@ fun ContactPickerScreen(modifier: Modifier) {
// of specific items (like a specific phone number or email) separately,
// rather than selecting the whole contact.
val pickContactIntent = Intent(ACTION_PICK_CONTACTS).apply {
putExtra(EXTRA_USE_SYSTEM_CONTACTS_PICKER, true)
putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true)
putStringArrayListExtra(
EXTRA_PICK_CONTACTS_REQUESTED_DATA_FIELDS,
Expand Down Expand Up @@ -281,4 +285,4 @@ private suspend fun processContactPickerResultUri(

return@withContext contactsMap.values.toList()
}
// [END android_contact_picker_result_uri_processing]
// [END android_contact_picker_result_uri_processing]
Loading