目录

UserAddress

Class Info

public final class UserAddress

用户地址信息,用户选择某地址后返回的数据。

Public Method Summary

Qualifier and Type

Method Name and Description

UserAddress

parseIntent(Intent data)

从Intent对象中解析出用户选择的地址信息。

String

getAddressLine1()

返回第一行地址。如果省略,则默认为“”。

String

getAddressLine2()

返回第二行地址。如果省略,则默认为“”。

String

getAddressLine3()

返回第三行地址。如果省略,则默认为“”。

String

getAddressLine4()

返回第四行地址。如果省略,则默认为“”。

String

getAddressLine5()

返回第五行地址。如果省略,则默认为“”。

String

getAdministrativeArea()

返回行政区域名称。如果省略,则默认为“”。

String

getCompanyName()

返回公司名称。如果省略,则默认为“”。

String

getCountryCode()

返回国家名称。如果省略,则默认为“”。

String

getCountryISOCode()

返回国家码。如果省略,则默认为“”。

String

getEmailAddress()

返回Email地址。如果省略,则默认为“”。

String

getLocality()

返回城市或城镇等信息。如果省略,则默认为“”。

String

getName()

返回姓名信息。如果省略,则默认为“”。

String

getPhoneNumber()

返回移动电话号码。如果省略,则默认为“”。

String

getPostalNumber()

返回邮政编码。如果省略,则默认为“”。

Public Methods

[h2]parseIntent

Method

public static UserAddress parseIntent(Intent data)

从Intent对象中解析用户地址数据,在Activity的onActivityResult中调用。

用户在选择地址后,地址结果信息将会携带在intent对象中,通过onActivityResult方法返回,使用parseIntent方法可以从Intent对象中解析出用户选择的地址信息。

Parameters

Name

Description

data

包含用户地址数据的Intent对象。

Returns

Type

Description

UserAddress

用户地址信息,用户选择某地址后返回的数据。

[h2]getAddressLine1

Method

public final String getAddressLine1()

返回第一行地址。

Returns

Type

Description

String

第一行地址。如果省略,则默认为“”。

[h2]getAddressLine2

Method

public final String getAddressLine2()

返回第二行地址。

Returns

Type

Description

String

第二行地址。如果省略,则默认为“”。

[h2]getAddressLine3

Method

public final String getAddressLine3()

返回第三行地址。

Returns

Type

Description

String

第三行地址。如果省略,则默认为“”。

[h2]getAddressLine4

Method

public final String getAddressLine4()

返回第四行地址。

Returns

Type

Description

String

第四行地址。如果省略,则默认为“”。

[h2]getAddressLine5

Method

public final String getAddressLine5()

返回第五行地址。

Returns

Type

Description

String

第五行地址。如果省略,则默认为“”。

[h2]getAdministrativeArea

Method

public final String getAdministrativeArea()

返回行政区域名称。

Returns

Type

Description

String

行政区域名称。如果省略,则默认为“”。

[h2]getCompanyName

Method

public final String getCompanyName()

返回公司名称。

Returns

Type

Description

String

公司名称。如果省略,则默认为“”。

[h2]getCountryCode

Method

public final String getCountryCode()

返回国家名称。

Returns

Type

Description

String

国家名称。如果省略,则默认为“”。

[h2]getCountryISOCode

Method

public final String getCountryISOCode()

返回国家码。

Returns

Type

Description

String

国家码。参见ISO 3166标准,如US、CN、MY。如果省略,则默认为“”。

[h2]getEmailAddress

Method

public final String getEmailAddress()

返回Email地址。

Returns

Type

Description

String

Email地址。如果省略,则默认为“”。

[h2]getLocality

Method

public final String getLocality()

返回城市或城镇等信息。

Returns

Type

Description

String

城市或城镇等信息。如果省略,则默认为“”。

[h2]getName

Method

public final String getName()

返回姓名信息。

Returns

Type

Description

String

姓名信息。如果省略,则默认为“”。

[h2]getPhoneNumber

Method

public final String getPhoneNumber()

返回移动电话号码。

Returns

Type

Description

String

移动电话号码。如果省略,则默认为“”。

[h2]getPostalNumber

Method

public final String getPostalNumber()

返回邮政编码。

Returns

Type

Description

String

邮政编码。如果省略,则默认为“”。