Most visited

Recently visited

Added in API level 5

ContactsContract.CommonDataKinds.Relation

public static final class ContactsContract.CommonDataKinds.Relation
extends Object implements ContactsContract.DataColumnsWithJoins, ContactsContract.CommonDataKinds.CommonColumns

java.lang.Object
   ↳ android.provider.ContactsContract.CommonDataKinds.Relation


表示关系的数据类型。

您可以使用为 ContactsContract.Data定义的所有列以及以下别名。

Column aliases

Type Alias Data column
String NAME DATA1
int TYPE DATA2 Allowed values are:

String LABEL DATA3

Summary

Constants

String CONTENT_ITEM_TYPE

将其存储在数据表中时使用的MIME类型。

String EXTRA_ADDRESS_BOOK_INDEX

将这个查询参数添加到一个URI以获取由地址簿索引分组的行计数作为游标额外。

String EXTRA_ADDRESS_BOOK_INDEX_COUNTS

相应组的组计数数组。

String EXTRA_ADDRESS_BOOK_INDEX_TITLES

地址簿索引标题数组,按照与游标中的数据相同的顺序返回。

String NAME

用户输入的亲戚名字。

int TYPE_ASSISTANT

int TYPE_BROTHER

int TYPE_CHILD

int TYPE_DOMESTIC_PARTNER

int TYPE_FATHER

int TYPE_FRIEND

int TYPE_MANAGER

int TYPE_MOTHER

int TYPE_PARENT

int TYPE_PARTNER

int TYPE_REFERRED_BY

int TYPE_RELATIVE

int TYPE_SISTER

int TYPE_SPOUSE

Inherited constants

From interface android.provider.ContactsContract.CommonDataKinds.CommonColumns
From interface android.provider.BaseColumns
From interface android.provider.ContactsContract.DataColumns
From interface android.provider.ContactsContract.StatusColumns
From interface android.provider.ContactsContract.RawContactsColumns
From interface android.provider.ContactsContract.ContactsColumns
From interface android.provider.ContactsContract.ContactNameColumns
From interface android.provider.ContactsContract.ContactOptionsColumns
From interface android.provider.ContactsContract.ContactStatusColumns
From interface android.provider.ContactsContract.DataUsageStatColumns
From interface android.provider.ContactsContract.CommonDataKinds.BaseTypes

Public methods

static final CharSequence getTypeLabel(Resources res, int type, CharSequence label)

返回一个 CharSequence最能描述给定的类型,可能取代定 LABEL的价值 TYPE_CUSTOM

static final int getTypeLabelResource(int type)

返回最能描述给定的 TYPE的字符串资源。

Inherited methods

From class java.lang.Object

Constants

CONTENT_ITEM_TYPE

Added in API level 5
String CONTENT_ITEM_TYPE

将其存储在数据表中时使用的MIME类型。

常量值:“vnd.android.cursor.item / relation”

EXTRA_ADDRESS_BOOK_INDEX

Added in API level 21
String EXTRA_ADDRESS_BOOK_INDEX

将这个查询参数添加到一个URI以获取由地址簿索引分组的行计数作为游标额外。 对于大多数语言来说,它是排序键的第一个字母。 该参数不影响游标的主要内容。

 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);
 }
 

常量值:“android.provider.extra.ADDRESS_BOOK_INDEX”

EXTRA_ADDRESS_BOOK_INDEX_COUNTS

Added in API level 21
String EXTRA_ADDRESS_BOOK_INDEX_COUNTS

相应组的组计数数组。 包含与EXTRA_ADDRESS_BOOK_INDEX_TITLES数组相同数量的元素。

TYPE: int[]

常量值:“android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS”

EXTRA_ADDRESS_BOOK_INDEX_TITLES

Added in API level 21
String EXTRA_ADDRESS_BOOK_INDEX_TITLES

地址簿索引标题数组,按照与游标中的数据相同的顺序返回。

TYPE: String[]

常量值:“android.provider.extra.ADDRESS_BOOK_INDEX_TITLES”

NAME

Added in API level 5
String NAME

用户输入的亲戚名字。

Type: TEXT

常量值:“data1”

TYPE_ASSISTANT

Added in API level 5
int TYPE_ASSISTANT

常数值:1(0x00000001)

TYPE_BROTHER

Added in API level 5
int TYPE_BROTHER

常量值:2(0x00000002)

TYPE_CHILD

Added in API level 5
int TYPE_CHILD

常量值:3(0x00000003)

TYPE_DOMESTIC_PARTNER

Added in API level 5
int TYPE_DOMESTIC_PARTNER

常量值:4(0x00000004)

TYPE_FATHER

Added in API level 5
int TYPE_FATHER

常量值:5(0x00000005)

TYPE_FRIEND

Added in API level 5
int TYPE_FRIEND

常数值:6(0x00000006)

TYPE_MANAGER

Added in API level 5
int TYPE_MANAGER

常量值:7(0x00000007)

TYPE_MOTHER

Added in API level 5
int TYPE_MOTHER

常量值:8(0x00000008)

TYPE_PARENT

Added in API level 5
int TYPE_PARENT

常量值:9(0x00000009)

TYPE_PARTNER

Added in API level 5
int TYPE_PARTNER

常量值:10(0x0000000a)

TYPE_REFERRED_BY

Added in API level 5
int TYPE_REFERRED_BY

常量值:11(0x0000000b)

TYPE_RELATIVE

Added in API level 5
int TYPE_RELATIVE

常量值:12(0x0000000c)

TYPE_SISTER

Added in API level 5
int TYPE_SISTER

常量值:13(0x0000000d)

TYPE_SPOUSE

Added in API level 5
int TYPE_SPOUSE

常量值:14(0x0000000e)

Public methods

getTypeLabel

Added in API level 11
CharSequence getTypeLabel (Resources res, 
                int type, 
                CharSequence label)

返回一个 CharSequence最能描述给定的类型,可能取代定 LABEL的价值 TYPE_CUSTOM

Parameters
res Resources
type int
label CharSequence
Returns
CharSequence

getTypeLabelResource

Added in API level 11
int getTypeLabelResource (int type)

返回最能描述给定TYPE的字符串资源。 将始终返回有效的资源。

Parameters
type int
Returns
int

Hooray!