public class PhoneNumber extends Object
SystemCapability.SysAppComponents#CONTACT| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
CUSTOM_LABEL |
Indicates a custom label.
|
static int |
INVALID_LABEL_ID |
Indicates an invalid label ID.
|
static int |
NUM_ASSISTANT |
Indicates an assistant number.
|
static int |
NUM_CALLBACK |
Indicates a callback number.
|
static int |
NUM_CAR |
Indicates a car number.
|
static int |
NUM_COMPANY_MAIN |
Indicates a company director number.
|
static int |
NUM_FAX_HOME |
Indicates a home fax number.
|
static int |
NUM_FAX_WORK |
Indicates a work fax number.
|
static int |
NUM_HOME |
Indicates a home number.
|
static int |
NUM_ISDN |
Indicates an Integrated Services Digital Network (ISDN) number.
|
static int |
NUM_MAIN |
Indicates a main number.
|
static int |
NUM_MMS |
Indicates an MMS number.
|
static int |
NUM_MOBILE |
Indicates a mobile phone number.
|
static int |
NUM_OTHER |
Indicates a number of the
OTHER type. |
static int |
NUM_OTHER_FAX |
Indicates a number of the
OTHER_FAX type. |
static int |
NUM_PAGER |
Indicates a pager number.
|
static int |
NUM_RADIO |
Indicates a radio number.
|
static int |
NUM_TELEX |
Indicates a telex number.
|
static int |
NUM_TTY_TDD |
Indicates a teletypewriter (TTY) or test-driven development (TDD) number.
|
static int |
NUM_WORK |
Indicates a work number.
|
static int |
NUM_WORK_MOBILE |
Indicates a work mobile phone number.
|
static int |
NUM_WORK_PAGER |
Indicates a work pager number.
|
| 构造器 | 说明 |
|---|---|
PhoneNumber(String number,
String customLabelName) |
A constructor used to create a
PhoneNumber instance based on a specified phone number
and a custom label name. |
PhoneNumber(Context context,
String number,
int labelId) |
A constructor used to create a
PhoneNumber instance based on the application context
and a specified phone number and label ID. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
equals(Object object) |
Indicates whether some other object is "equal to" this one.
|
String |
getLabelName() |
Obtains the label name of an attribute.
|
String |
getPhoneNumber() |
Obtains the phone number of this contact.
|
int |
hashCode() |
Returns a hash code value for the object.
|
void |
setCustomLabelName(String labelName) |
Set custom label data.
|
void |
setLabelId(Context context,
int labelId) |
Set label id and name.
|
void |
setPhoneNumber(String phoneNumber) |
Sets the phone number for this contact.
|
public static final int CUSTOM_LABEL
If this label type is used, attribute CustomLabelName must be set.
public static final int INVALID_LABEL_ID
public static final int NUM_ASSISTANT
public static final int NUM_CALLBACK
public static final int NUM_CAR
public static final int NUM_COMPANY_MAIN
public static final int NUM_FAX_HOME
public static final int NUM_FAX_WORK
public static final int NUM_HOME
public static final int NUM_ISDN
public static final int NUM_MAIN
public static final int NUM_MMS
public static final int NUM_MOBILE
public static final int NUM_OTHER
OTHER type.public static final int NUM_OTHER_FAX
OTHER_FAX type.public static final int NUM_PAGER
public static final int NUM_RADIO
public static final int NUM_TELEX
public static final int NUM_TTY_TDD
public static final int NUM_WORK
public static final int NUM_WORK_MOBILE
public static final int NUM_WORK_PAGER
public PhoneNumber(Context context, String number, int labelId)
PhoneNumber instance based on the application context
and a specified phone number and label ID.
The label ID can be any of the following:
context - Indicates the application context.number - Indicates the phone number.labelId - Indicates the label ID.public void setPhoneNumber(String phoneNumber)
phoneNumber - Indicates the phone number to set.public String getPhoneNumber()
public void setCustomLabelName(String labelName)
labelName - Indicates the custom label name to set.public int hashCode()
HashMap.hashCode 在类中 ObjectObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public void setLabelId(Context context, int labelId)
context - Indicates the application context.labelId - Indicates the label ID to set.public boolean equals(Object object)
equals 在类中 Objectobj - the reference object with which to compare.true if this object is the same as the obj argument;
false otherwise.Object.hashCode(),
HashMappublic String getLabelName()