Stay organized with collections
Save and categorize content based on your preferences.
class Contactables : ContactsContract.CommonDataKinds.CommonColumns, ContactsContract.DataColumnsWithJoins
A special class of data items, used to refer to types of data that can be used to attempt to start communicating with a person (Phone
and Email
). Note that this is NOT a separate data kind. This URI allows the ContactsProvider to return a unified result for data items that users can use to initiate communications with another contact. Phone
and Email
are the current data types in this category.
Summary
Constants |
static String |
Add this query parameter to a URI to get back row counts grouped by the address book index as cursor extras.
|
static String |
The array of group counts for the corresponding group.
|
static String |
The array of address book index titles, which are returned in the same order as the data in the cursor.
|
static String |
A boolean parameter for Data.CONTENT_URI .
|
Inherited constants |
From class CommonColumns
String |
DATA
The data for the contact method.
Type: TEXT
|
String |
LABEL
The user defined label for the the contact method.
Type: TEXT
|
String |
TYPE
The type of data, for example Home or Work.
Type: INTEGER
|
|
|
Properties |
static Uri! |
The content:// style URI for these data items, which allows for a query parameter to be appended onto the end to filter for data items matching the query.
|
static Uri! |
The content:// style URI for these data items, which requests a directory of data rows matching the selection criteria.
|
Constants
static val EXTRA_ADDRESS_BOOK_INDEX: String
Add this query parameter to a URI to get back row counts grouped by the address book index as cursor extras. For most languages it is the first letter of the sort key. This parameter does not affect the main content of the cursor.
Example:
import android.provider.ContactsContract.Contacts;
Uri uri = Contacts.CONTENT_URI.buildUpon()
.appendQueryParameter(Contacts.EXTRA_ADDRESS_BOOK_INDEX, "true")
.build();
Cursor cursor = getContentResolver().query(uri,
new String[] {Contacts.DISPLAY_NAME},
null, null, null);
Bundle bundle = cursor.getExtras();
if (bundle.containsKey(Contacts.EXTRA_ADDRESS_BOOK_INDEX_TITLES) &&
bundle.containsKey(Contacts.EXTRA_ADDRESS_BOOK_INDEX_COUNTS)) {
String sections[] =
bundle.getStringArray(Contacts.EXTRA_ADDRESS_BOOK_INDEX_TITLES);
int counts[] = bundle.getIntArray(Contacts.EXTRA_ADDRESS_BOOK_INDEX_COUNTS);
}
Value: "android.provider.extra.ADDRESS_BOOK_INDEX"
static val EXTRA_ADDRESS_BOOK_INDEX_COUNTS: String
The array of group counts for the corresponding group. Contains the same number of elements as the EXTRA_ADDRESS_BOOK_INDEX_TITLES array.
TYPE: int[]
Value: "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS"
static val EXTRA_ADDRESS_BOOK_INDEX_TITLES: String
The array of address book index titles, which are returned in the same order as the data in the cursor.
TYPE: String[]
Value: "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES"
static val VISIBLE_CONTACTS_ONLY: String
A boolean parameter for Data.CONTENT_URI
. This specifies whether or not the returned data items should be filtered to show data items belonging to visible contacts only.
Value: "visible_contacts_only"
Public constructors
Properties
CONTENT_FILTER_URI
static val CONTENT_FILTER_URI: Uri!
The content:// style URI for these data items, which allows for a query parameter to be appended onto the end to filter for data items matching the query.
Caution: If you publish your app to the Google Play Store, this field doesn't sort results based on contacts frequency. For more information, see the Contacts Provider page.
CONTENT_URI
static val CONTENT_URI: Uri!
The content:// style URI for these data items, which requests a directory of data rows matching the selection criteria.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# ContactsContract.CommonDataKinds.Contactables\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nContactables\n============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/provider/ContactsContract.CommonDataKinds.Contactables \"View this page in Java\") \n\n```\nclass Contactables : ContactsContract.CommonDataKinds.CommonColumns, ContactsContract.DataColumnsWithJoins\n```\n\n|---|---------------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.provider.ContactsContract.CommonDataKinds.Contactables](#) |\n\nA special class of data items, used to refer to types of data that can be used to attempt to start communicating with a person ([Phone](/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.Phone) and [Email](/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.Email)). Note that this is NOT a separate data kind. This URI allows the ContactsProvider to return a unified result for data items that users can use to initiate communications with another contact. [Phone](/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.Phone) and [Email](/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.Email) are the current data types in this category.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_ADDRESS_BOOK_INDEX](#EXTRA_ADDRESS_BOOK_INDEX:kotlin.String) Add this query parameter to a URI to get back row counts grouped by the address book index as cursor extras. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_ADDRESS_BOOK_INDEX_COUNTS](#EXTRA_ADDRESS_BOOK_INDEX_COUNTS:kotlin.String) The array of group counts for the corresponding group. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_ADDRESS_BOOK_INDEX_TITLES](#EXTRA_ADDRESS_BOOK_INDEX_TITLES:kotlin.String) The array of address book index titles, which are returned in the same order as the data in the cursor. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [VISIBLE_CONTACTS_ONLY](#VISIBLE_CONTACTS_ONLY:kotlin.String) A boolean parameter for [Data.CONTENT_URI](/reference/kotlin/android/provider/ContactsContract.Data#CONTENT_URI:android.net.Uri). |\n\n| Inherited constants ||\n|---|---|\n| From class [CommonColumns](/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns) |----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DATA](/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#DATA:kotlin.String) The data for the contact method. Type: TEXT \u003cbr /\u003e | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [LABEL](/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#LABEL:kotlin.String) The user defined label for the the contact method. Type: TEXT \u003cbr /\u003e | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [TYPE](/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.CommonColumns#TYPE:kotlin.String) The type of data, for example Home or Work. Type: INTEGER \u003cbr /\u003e | ||\n| From class [BaseTypes](/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.BaseTypes) |----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [TYPE_CUSTOM](/reference/kotlin/android/provider/ContactsContract.CommonDataKinds.BaseTypes#TYPE_CUSTOM:kotlin.Int) A custom type. The custom label should be supplied by user. \u003cbr /\u003e | ||\n\n| Public constructors ||\n|--------------------------------------------|---|\n| [Contactables](#Contactables())`()` \u003cbr /\u003e |\n\n| Properties ||\n|---------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [Uri](../net/Uri.html#)! | [CONTENT_FILTER_URI](#CONTENT_FILTER_URI:android.net.Uri) The content:// style URI for these data items, which allows for a query parameter to be appended onto the end to filter for data items matching the query. |\n| static [Uri](../net/Uri.html#)! | [CONTENT_URI](#CONTENT_URI:android.net.Uri) The content:// style URI for these data items, which requests a directory of data rows matching the selection criteria. |\n\nConstants\n---------\n\n### EXTRA_ADDRESS_BOOK_INDEX\n\n```\nstatic val EXTRA_ADDRESS_BOOK_INDEX: String\n```\n\nAdd this query parameter to a URI to get back row counts grouped by the address book index as cursor extras. For most languages it is the first letter of the sort key. This parameter does not affect the main content of the cursor.\n\n```kotlin\nExample:\n \n import android.provider.ContactsContract.Contacts;\n \n Uri uri = Contacts.CONTENT_URI.buildUpon()\n .appendQueryParameter(Contacts.EXTRA_ADDRESS_BOOK_INDEX, \"true\")\n .build();\n Cursor cursor = getContentResolver().query(uri,\n new String[] {Contacts.DISPLAY_NAME},\n null, null, null);\n Bundle bundle = cursor.getExtras();\n if (bundle.containsKey(Contacts.EXTRA_ADDRESS_BOOK_INDEX_TITLES) &&\n bundle.containsKey(Contacts.EXTRA_ADDRESS_BOOK_INDEX_COUNTS)) {\n String sections[] =\n bundle.getStringArray(Contacts.EXTRA_ADDRESS_BOOK_INDEX_TITLES);\n int counts[] = bundle.getIntArray(Contacts.EXTRA_ADDRESS_BOOK_INDEX_COUNTS);\n }\n \n```\n\n\u003cbr /\u003e\n\n Value: \"android.provider.extra.ADDRESS_BOOK_INDEX\"\n\n### EXTRA_ADDRESS_BOOK_INDEX_COUNTS\n\n```\nstatic val EXTRA_ADDRESS_BOOK_INDEX_COUNTS: String\n```\n\nThe array of group counts for the corresponding group. Contains the same number of elements as the EXTRA_ADDRESS_BOOK_INDEX_TITLES array.\n\nTYPE: int\\[\\] \n\n Value: \"android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS\"\n\n### EXTRA_ADDRESS_BOOK_INDEX_TITLES\n\n```\nstatic val EXTRA_ADDRESS_BOOK_INDEX_TITLES: String\n```\n\nThe array of address book index titles, which are returned in the same order as the data in the cursor.\n\nTYPE: String\\[\\] \n\n Value: \"android.provider.extra.ADDRESS_BOOK_INDEX_TITLES\"\n\n### VISIBLE_CONTACTS_ONLY\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val VISIBLE_CONTACTS_ONLY: String\n```\n\nA boolean parameter for [Data.CONTENT_URI](/reference/kotlin/android/provider/ContactsContract.Data#CONTENT_URI:android.net.Uri). This specifies whether or not the returned data items should be filtered to show data items belonging to visible contacts only. \n\n Value: \"visible_contacts_only\"\n\nPublic constructors\n-------------------\n\n### Contactables\n\n```\nContactables()\n```\n\nProperties\n----------\n\n### CONTENT_FILTER_URI\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CONTENT_FILTER_URI: Uri!\n```\n\nThe content:// style URI for these data items, which allows for a query parameter to be appended onto the end to filter for data items matching the query.\n\n**Caution:** If you publish your app to the Google Play Store, this field doesn't sort results based on contacts frequency. For more information, see the [Contacts Provider](../../guide/topics/providers/contacts-provider#ObsoleteData) page. \n\n### CONTENT_URI\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CONTENT_URI: Uri!\n```\n\nThe content:// style URI for these data items, which requests a directory of data rows matching the selection criteria."]]