Class Info |
|---|
public class LocationResult implements Parcelable, IMessageEntity 定位的数据信息类,在调用该类的create(List<HWLocation>locations)方法时会返回一个该类型的实例。 |
Qualifier and Type | Field and Description |
|---|---|
static final Creator<LocationResult> | LocationResult构建器。 |
Qualifier and Type | Method Name and Description |
|---|---|
static LocationResult | create(List<HWLocation> locations) 为指定位置创建LocationResult。 |
static LocationResult | extractResult(Intent intent) 从intent中获取LocationResult对象。 |
List<HWLocation> | 返回可用的位置列表,包括详细地址信息。 |
| 返回getHWLocationList()可用位置列表中最后一个位置,包括详细地址信息。 | |
final Location | 返回getLocations()可用位置列表中最后一个位置,如果没有可用位置,则返回null。 |
final List<Location> | 返回可用的位置集合。 |
static boolean | hasResult(Intent intent) 检查intent中是否包含LocationResult。 |
Fields |
|---|
public static final Creator<LocationResult> CREATOR LocationResult构建器。用以反序列化定位的数据信息类时使用。 |
Method |
|---|
public static LocationResult create(List<HWLocation>locations) 为指定位置创建LocationResult。 |
Parameters
Name | Description |
|---|---|
locations | 位置列表。 |
Returns
Type | Description |
|---|---|
LocationResult | LocationResult对象。 |
Method |
|---|
public static LocationResult extractResult(Intent intent) 从intent中获取LocationResult对象。 |
Parameters
Name | Description |
|---|---|
intent | 调用requestLocationUpdates接口,传递给服务端的Intent。 |
Returns
Type | Description |
|---|---|
LocationResult | LocationResult对象。 |
Method |
|---|
public final List<HWLocation> getHWLocationList() 返回可用的位置列表,包括详细地址信息。 |
Returns
Type | Description |
|---|---|
List<HWLocation> | 可用的位置,从最旧到最新排序,包括详细地址信息。如果没有则返回null。 |
Method |
|---|
public final HWLocation getLastHWLocation() 返回getHWLocationList()可用位置列表中最后一个位置,包括详细地址信息。 |
Returns
Type | Description |
|---|---|
可用位置列表中最后一个位置,包括详细地址信息。如果没有可用位置,则返回null。 |
Method |
|---|
public final Location getLastLocation() 返回getLocations()可用位置列表中最后一个位置,如果没有可用位置,则返回null。 |
Returns
Type | Description |
|---|---|
Location | 如果没有可用位置,则返回null。此类为Android原生类,具体介绍请参见Android官方开发文档。 |
Method |
|---|
public List<Location> getLocations() 返回可用的位置集合。 |
Returns
Type | Description |
|---|---|
List<Location> | 可用的位置,从最旧到最新排序。 |
Method |
|---|
public static boolean hasResult(Intent intent) 检查intent中是否包含LocationResult。如果intent包含LocationResult,则返回true,反之则为false。 |
Parameters
Name | Description |
|---|---|
intent | 调用requestLocationUpdates接口,传递给服务端的Intent。 |
Returns
Type | Description |
|---|---|
boolean | 如果intent包含LocationResult,则为true,否则为false。 |