目录

CLASS info
public static class LocationResult extends Result
Location data information class.

Field Summary

Return typeMethod nameDescription
Creator<LocationResult>CREATORLocationResult builder.

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)
This API is used to create a LocationResult object for the given location.

Parameters

Parameter nameParameter desc
locationsLocation list.

Return

typedesc
LocationResultLocationResult object.
Method
public static LocationResult extractResult(Intent intent)
This API is used to extract LocationResult from Intent.

Parameters

Parameter nameParameter desc
intentIntent transferred to the server when the requestLocationUpdates API is called.

Return

typedesc
LocationResultThis parameter returns the location result if the Intent contains LocationResult, or null if the Intent does not contain LocationResult.
Method
public final Location getLastLocation()
This API is used to obtain the latest available location. If no location is available, null is returned.

Return

typedesc
LocationLatest available location. If no location is available, null is returned. This class is native to Android.For details, please refer to the Android development documentation.
Method
public List<Location> getLocations()
This API is used to obtain the list of available locations.

Return

typedesc
List<Location>Available locations, which are ordered from oldest to newest.
Method
public static boolean hasResult(Intent intent)
This API returns true if an Intent contains the LocationResult object.

Parameters

Parameter nameParameter desc
intentIntent transferred to the server when the requestLocationUpdates API is called.

Return

typedesc
booleanIf the Intent contains LocationResult, the value is true. Otherwise, the value is false.
Method
public final HWLocation getLastHWLocation()

This API is used to obtain the available location of the last request, including the detailed address information.

Return

typedesc
HWLocationAvailable location of the last request, including the detailed address information. If no location is available, null is returned.
Method
public final List<HWLocation> getHWLocationList()
This API is used to obtain the list of available locations, including the detailed address information.

Return

typedesc
List<HWLocation>List of available locations sorted from oldest to newest, including the detailed address information. If no location is available, null is returned.