public class LocationRequest extends Object
LocationRequest handles getting the current location of the device for a one time use.
Modifier and Type | Class and Description |
---|---|
static class |
LocationRequest.ErrorType
Error states for a location request.
|
static interface |
LocationRequest.LocationRequestListener
A listener for receiving the results of the request.
|
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_MAX_AGE |
static long |
DEFAULT_TIME_OUT |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels this request.
|
boolean |
isRunning()
Returns
true if this request is still running. |
static LocationRequest |
requestCurrentLocation(Context context,
EditorKey appKey,
LocationRequest.LocationRequestListener responseListener)
Builds and starts a LocationRequest with the given parameters.
|
static LocationRequest |
requestCurrentLocation(Context context,
EditorKey appKey,
LocationRequest.LocationRequestListener responseListener,
long timeOutInMilliseconds)
Builds and starts a LocationRequest with the given parameters.
|
static LocationRequest |
requestCurrentLocation(Context context,
EditorKey appKey,
LocationRequest.LocationRequestListener responseListener,
long timeOutInMilliseconds,
long maxAgeInMilliseconds)
Builds and starts a LocationRequest with the given parameters.
|
public static final long DEFAULT_TIME_OUT
public static final long DEFAULT_MAX_AGE
public void cancel()
Cancels this request.
public boolean isRunning()
Returns true
if this request is still running.
public static LocationRequest requestCurrentLocation(Context context, EditorKey appKey, LocationRequest.LocationRequestListener responseListener)
Builds and starts a LocationRequest with the given parameters.
public static LocationRequest requestCurrentLocation(Context context, EditorKey appKey, LocationRequest.LocationRequestListener responseListener, long timeOutInMilliseconds)
Builds and starts a LocationRequest with the given parameters.
public static LocationRequest requestCurrentLocation(@NonNull Context context, @NonNull EditorKey appKey, @NonNull LocationRequest.LocationRequestListener responseListener, long timeOutInMilliseconds, long maxAgeInMilliseconds)
Builds and starts a LocationRequest with the given parameters.