目录

CLASS info
public static class LocationResult extends Result
定位的数据信息类。

Field Summary

Return typeMethod nameDescription
Creator<LocationResult>CREATORLocationResult 构建器。

Public Method Summary

Return typeMethod name
static LocationResultcreate(List<Location> locations)
static LocationResultextractResult(Intent intent)
final LocationgetLastLocation()
final List<Location>getLocations()
static booleanhasResult(Intent intent)
HWLocationgetLastHWLocation()
List<HWLocation>getHWLocationList()

Public Methods

Method
public static LocationResult create(List<Location>locations)
为指定位置创建LocationResult。

Parameters

Parameter nameParameter desc
locations位置列表

Return

typedesc
LocationResultLocationResult对象
Method
public static LocationResult extractResult(Intent intent)
从intent中获取LocationResult对象。

Parameters

Parameter nameParameter desc
intent调用requestLocationUpdates接口,传递给服务端的Intent。

Return

typedesc
LocationResultLocationResult对象
Method
public final Location getLastLocation()
返回最后一次请求的可用位置,如果没有可用位置,则返回null。

Return

typedesc
Location如果没有可用位置,则返回null。此类为Android原生类,具体介绍请参见Android开发文档。
Method
public List<Location> getLocations()
返回可用的位置集合。

Return

typedesc
List<Location>可用的位置,从最旧到最新排序。
Method
public static boolean hasResult(Intent intent)
检查Intent中是否包含LocationResult。如果Intent包含LocationResult,则返回true ,反之则为false。

Parameters

Parameter nameParameter desc
intent调用requestLocationUpdates接口,传递给服务端的Intent。

Return

typedesc
boolean如果intent包含LocationResult,则为true ,否则为false。
Method
public final HWLocation getLastHWLocation()
返回最后一次请求的可用位置,包括详细地址信息。

Return

typedesc
HWLocation最后一次请求的可用位置,包括详细地址信息。如果没有可用位置,则返回null。
Method
public final List<HWLocation> getHWLocationList()
返回可用的位置列表,包括详细地址信息。

Return

typedesc
List<HWLocation>可用的位置,从最旧到最新排序,包括详细地址信息。如果没有则返回null。