| CLASS info |
| public static class LocationResult extends Result |
| 定位的数据信息类。 |
| Return type | Method name | Description |
| Creator<LocationResult> | CREATOR | LocationResult 构建器。 |
| Return type | Method name |
| static LocationResult | create(List<Location> locations) |
| static LocationResult | extractResult(Intent intent) |
| final Location | getLastLocation() |
| final List<Location> | getLocations() |
| static boolean | hasResult(Intent intent) |
| HWLocation | getLastHWLocation() |
| List<HWLocation> | getHWLocationList() |
| Method |
| public static LocationResult create(List<Location>locations) |
| 为指定位置创建LocationResult。 |
Parameters
| Parameter name | Parameter desc |
| locations | 位置列表 |
Return
| type | desc |
| LocationResult | LocationResult对象 |
| Method |
| public static LocationResult extractResult(Intent intent) |
| 从intent中获取LocationResult对象。 |
Parameters
| Parameter name | Parameter desc |
| intent | 调用requestLocationUpdates接口,传递给服务端的Intent。 |
Return
| type | desc |
| LocationResult | LocationResult对象 |
| Method |
| public final Location getLastLocation() |
| 返回最后一次请求的可用位置,如果没有可用位置,则返回null。 |
Return
| type | desc |
| Location | 如果没有可用位置,则返回null。此类为Android原生类,具体介绍请参见Android开发文档。 |
| Method |
| public List<Location> getLocations() |
| 返回可用的位置集合。 |
Return
| type | desc |
| List<Location> | 可用的位置,从最旧到最新排序。 |
| Method |
| public static boolean hasResult(Intent intent) |
| 检查Intent中是否包含LocationResult。如果Intent包含LocationResult,则返回true ,反之则为false。 |
Parameters
| Parameter name | Parameter desc |
| intent | 调用requestLocationUpdates接口,传递给服务端的Intent。 |
Return
| type | desc |
| boolean | 如果intent包含LocationResult,则为true ,否则为false。 |
| Method |
| public final HWLocation getLastHWLocation() |
| 返回最后一次请求的可用位置,包括详细地址信息。 |
Return
| type | desc |
| HWLocation | 最后一次请求的可用位置,包括详细地址信息。如果没有可用位置,则返回null。 |
| Method |
| public final List<HWLocation> getHWLocationList() |
| 返回可用的位置列表,包括详细地址信息。 |
Return
| type | desc |
| List<HWLocation> | 可用的位置,从最旧到最新排序,包括详细地址信息。如果没有则返回null。 |