Most visited

Recently visited

Added in API level 5

ContactsContract.PhoneLookup

public static final class ContactsContract.PhoneLookup
extends Object implements BaseColumns, ContactsContract.PhoneLookupColumns, ContactsContract.ContactsColumns, ContactsContract.ContactOptionsColumns

java.lang.Object
   ↳ android.provider.ContactsContract.PhoneLookup


代表查找电话号码结果的表格,例如来电号码。 要执行查找,您必须在CONTENT_FILTER_URI附加您想要查找的CONTENT_FILTER_URI 这个查询是高度优化的。

 Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
 resolver.query(uri, new String[]{PhoneLookup.DISPLAY_NAME,...
 

Columns

PhoneLookup
String NUMBER read-only Phone number.
String TYPE read-only Phone number type. See ContactsContract.CommonDataKinds.Phone.
String LABEL read-only Custom label for the phone number. See ContactsContract.CommonDataKinds.Phone.

“联系人”表中的列也可通过联接使用。

Join with Contacts
long _ID read-only Contact ID.
long CONTACT_ID read-only Contact ID.
long DATA_ID read-only Data ID.
String LOOKUP_KEY read-only See ContactsContract.Contacts
String DISPLAY_NAME read-only See ContactsContract.Contacts
long PHOTO_ID read-only See ContactsContract.Contacts.
int IN_VISIBLE_GROUP read-only See ContactsContract.Contacts.
int HAS_PHONE_NUMBER read-only See ContactsContract.Contacts.
int TIMES_CONTACTED read-only See ContactsContract.Contacts.
long LAST_TIME_CONTACTED read-only See ContactsContract.Contacts.
int STARRED read-only See ContactsContract.Contacts.
String CUSTOM_RINGTONE read-only See ContactsContract.Contacts.
int SEND_TO_VOICEMAIL read-only See ContactsContract.Contacts.

Summary

Constants

String QUERY_PARAMETER_SIP_ADDRESS

如果此布尔参数设置为true,则附加的查询将被视为SIP地址,并将根据用户联系人中的SIP地址执行查找。

Inherited constants

From interface android.provider.BaseColumns
From interface android.provider.ContactsContract.PhoneLookupColumns
From interface android.provider.ContactsContract.ContactsColumns
From interface android.provider.ContactsContract.ContactOptionsColumns

Fields

public static final Uri CONTENT_FILTER_URI

该表格的内容://样式URI。

public static final Uri ENTERPRISE_CONTENT_FILTER_URI

用于“企业呼叫者ID”的URI。

Inherited methods

From class java.lang.Object

Constants

QUERY_PARAMETER_SIP_ADDRESS

Added in API level 21
String QUERY_PARAMETER_SIP_ADDRESS

如果此布尔参数设置为true,则附加的查询将被视为SIP地址,并将根据用户联系人中的SIP地址执行查找。

常数值:“sip”

Fields

CONTENT_FILTER_URI

Added in API level 5
Uri CONTENT_FILTER_URI

该表格的内容://样式URI。 将要查找的电话号码附加到此URI并查询它以执行查找。 例如:

 Uri lookupUri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI,
         Uri.encode(phoneNumber));
 

ENTERPRISE_CONTENT_FILTER_URI

Added in API level 21
Uri ENTERPRISE_CONTENT_FILTER_URI

用于“企业呼叫者ID”的URI。

它支持与CONTENT_FILTER_URI相同的语义并返回相同的列。 如果设备没有链接到当前配置文件的corp配置文件,则它的行为方式与CONTENT_FILTER_URI 如果有一个corp配置文件链接到当前配置文件,它首先查询个人联系人数据库,如果没有找到匹配的联系人,则查询corp联系人数据库。

如果结果来自corp配置文件,则会对数据进行以下更改:

getLookupUri(long, String)构建的 _IDLOOKUP_KEY由该API返回的联系人查找URL可以传递给 showQuickContact(Context, Rect, Uri, int, String[])即使联系人来自公司配置文件。

 Uri lookupUri = Uri.withAppendedPath(PhoneLookup.ENTERPRISE_CONTENT_FILTER_URI,
         Uri.encode(phoneNumber));
 

Hooray!