AI-generated Key Takeaways
-
LastLocationRequest
encapsulates parameters for requesting a cached last location throughFusedLocationProviderClient
. -
It allows specifying the desired granularity (fine or coarse) of the location data.
-
You can set a maximum age for the returned location, ensuring data freshness.
-
It's used with
FusedLocationProviderClient.getLastLocation(LastLocationRequest)
to retrieve the last known location. -
LastLocationRequest.Builder
facilitates the construction ofLastLocationRequest
instances.
An encapsulation of various parameters for requesting a (cached) last location through
FusedLocationProviderClient
.
Nested Class Summary
class | LastLocationRequest.Builder | A builder for LastLocationRequest . |
Inherited Constant Summary
Field Summary
public static final Creator<LastLocationRequest> | CREATOR |
Public Method Summary
boolean | |
int |
getGranularity()
The
Granularity
of locations returned for this request.
|
long |
getMaxUpdateAgeMillis()
The maximum age of any location returned for this request.
|
int |
hashCode()
|
String |
toString()
|
void |
writeToParcel(Parcel parcel, int
flags)
|
Inherited Method Summary
Fields
public static final Creator<LastLocationRequest> CREATOR
Public Methods
public boolean equals (Object object)
public int getGranularity ()
The Granularity
of locations returned for this request. This controls whether fine or coarse locations
may be returned.
public long getMaxUpdateAgeMillis ()
The maximum age of any location returned for this request. A value of Long.MAX_VALUE
represents an effectively unbounded maximum age.