LastLocationRequest
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Public Method Summary
boolean |
|
int |
|
long |
|
int |
|
String
|
|
void |
|
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
From interface android.os.Parcelable
abstract int |
describeContents()
|
abstract void |
writeToParcel( Parcel arg0,
int arg1)
|
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.
public void writeToParcel (Parcel parcel, int
flags)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eLastLocationRequest\u003c/code\u003e encapsulates parameters for requesting a cached last location through \u003ccode\u003eFusedLocationProviderClient\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt allows specifying the desired granularity (fine or coarse) of the location data.\u003c/p\u003e\n"],["\u003cp\u003eYou can set a maximum age for the returned location, ensuring data freshness.\u003c/p\u003e\n"],["\u003cp\u003eIt's used with \u003ccode\u003eFusedLocationProviderClient.getLastLocation(LastLocationRequest)\u003c/code\u003e to retrieve the last known location.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eLastLocationRequest.Builder\u003c/code\u003e facilitates the construction of \u003ccode\u003eLastLocationRequest\u003c/code\u003e instances.\u003c/p\u003e\n"]]],[],null,["# LastLocationRequest\n\npublic final class **LastLocationRequest** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nAn encapsulation of various parameters for requesting a (cached) last location through\n[FusedLocationProviderClient](/android/reference/com/google/android/gms/location/FusedLocationProviderClient). \n\n##### See Also\n\n- [FusedLocationProviderClient.getLastLocation(LastLocationRequest)](/android/reference/com/google/android/gms/location/FusedLocationProviderClient#getLastLocation(com.google.android.gms.location.LastLocationRequest)) \n\n### Nested Class Summary\n\n|-------|---|---|--------------------------------------------------------------------------------------------------------------|\n| class | [LastLocationRequest.Builder](/android/reference/com/google/android/gms/location/LastLocationRequest.Builder) || A builder for [LastLocationRequest](/android/reference/com/google/android/gms/location/LastLocationRequest). |\n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Field Summary\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|---|\n| public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[LastLocationRequest](/android/reference/com/google/android/gms/location/LastLocationRequest)\\\u003e | [CREATOR](/android/reference/com/google/android/gms/location/LastLocationRequest#CREATOR) | |\n\n### Public Method Summary\n\n|-------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/android/gms/location/LastLocationRequest#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) object) |\n| int | [getGranularity](/android/reference/com/google/android/gms/location/LastLocationRequest#getGranularity())() The [Granularity](/android/reference/com/google/android/gms/location/Granularity) of locations returned for this request. |\n| long | [getMaxUpdateAgeMillis](/android/reference/com/google/android/gms/location/LastLocationRequest#getMaxUpdateAgeMillis())() The maximum age of any location returned for this request. |\n| int | [hashCode](/android/reference/com/google/android/gms/location/LastLocationRequest#hashCode())() |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/android/gms/location/LastLocationRequest#toString())() |\n| void | [writeToParcel](/android/reference/com/google/android/gms/location/LastLocationRequest#writeToParcel(android.os.Parcel,%20int))([Parcel](//developer.android.com/reference/android/os/Parcel.html) parcel, int flags) |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nFields\n------\n\n#### public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[LastLocationRequest](/android/reference/com/google/android/gms/location/LastLocationRequest)\\\u003e\n**CREATOR**\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) object)\n\n#### public int **getGranularity** ()\n\nThe [Granularity](/android/reference/com/google/android/gms/location/Granularity)\nof locations returned for this request. This controls whether fine or coarse locations\nmay be returned. \n\n#### public long **getMaxUpdateAgeMillis** ()\n\nThe maximum age of any location returned for this request. A value of [Long.MAX_VALUE](//developer.android.com/reference/java/lang/Long.html#MAX_VALUE)\nrepresents an effectively unbounded maximum age. \n\n#### public int **hashCode** ()\n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **toString** ()\n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) parcel, int flags)"]]