Stay organized with collections
Save and categorize content based on your preferences.
Interfaces
Classes
Extension functions summary
Extension functions
inline operator fun Location.component1(): Double
Returns the latitude of this Location
.
This method allows to use destructuring declarations when working with Location
, for example:
val (lat, lon) = myLocation
inline operator fun Location.component2(): Double
Returns the longitude of this Location
.
This method allows to use destructuring declarations when working with Location
, for example:
val (lat, lon) = myLocation
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-15 UTC.
[null,null,["Last updated 2025-05-15 UTC."],[],[],null,["# androidx.core.location\n======================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/androidx/core/location/package-summary \"View this page in Java\")\n\nInterfaces\n----------\n\n|-------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| [LocationListenerCompat](/reference/kotlin/androidx/core/location/LocationListenerCompat) | A version of [LocationListener](https://developer.android.com/reference/android/location/LocationListener.html) suitable for use on all API levels. |\n\nClasses\n-------\n\n|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| [GnssStatusCompat](/reference/kotlin/androidx/core/location/GnssStatusCompat) | GnssStatus representation that works across all Android versions. |\n| [GnssStatusCompat.Callback](/reference/kotlin/androidx/core/location/GnssStatusCompat.Callback) | See [GnssStatus.Callback](https://developer.android.com/reference/android/location/GnssStatus.Callback.html). |\n| [LocationCompat](/reference/kotlin/androidx/core/location/LocationCompat) | Helper for accessing features in [android.location.Location](https://developer.android.com/reference/android/location/Location.html). |\n| [LocationManagerCompat](/reference/kotlin/androidx/core/location/LocationManagerCompat) | Helper for accessing features in [LocationManager](https://developer.android.com/reference/android/location/LocationManager.html). |\n| [LocationRequestCompat](/reference/kotlin/androidx/core/location/LocationRequestCompat) | Compatibility version of [LocationRequest](https://developer.android.com/reference/android/location/LocationRequest.html). |\n| [LocationRequestCompat.Builder](/reference/kotlin/androidx/core/location/LocationRequestCompat.Builder) | A builder class for [LocationRequestCompat](/reference/kotlin/androidx/core/location/LocationRequestCompat). |\n\nExtension functions summary\n---------------------------\n\n|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `inline operator `[Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) | [Location](https://developer.android.com/reference/android/location/Location.html)`.`[component1](/reference/kotlin/androidx/core/location/package-summary#(android.location.Location).component1())`()` Returns the latitude of this [Location](https://developer.android.com/reference/android/location/Location.html). |\n| `inline operator `[Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html) | [Location](https://developer.android.com/reference/android/location/Location.html)`.`[component2](/reference/kotlin/androidx/core/location/package-summary#(android.location.Location).component2())`()` Returns the longitude of this [Location](https://developer.android.com/reference/android/location/Location.html). |\n\nExtension functions\n-------------------\n\n### component1\n\nArtifact: [androidx.core:core-ktx](/jetpack/androidx/releases/core) \n[View Source](https://cs.android.com/search?q=file:androidx/core/location/Location.kt+function:component1) \nAdded in [1.1.0](/jetpack/androidx/releases/core#1.1.0) \n\n```\ninline operator fun Location.component1(): Double\n```\n\nReturns the latitude of this [Location](https://developer.android.com/reference/android/location/Location.html).\n\nThis method allows to use destructuring declarations when working with [Location](https://developer.android.com/reference/android/location/Location.html), for example: \n\n```kotlin\nval (lat, lon) = myLocation\n``` \n\n### component2\n\nArtifact: [androidx.core:core-ktx](/jetpack/androidx/releases/core) \n[View Source](https://cs.android.com/search?q=file:androidx/core/location/Location.kt+function:component2) \nAdded in [1.1.0](/jetpack/androidx/releases/core#1.1.0) \n\n```\ninline operator fun Location.component2(): Double\n```\n\nReturns the longitude of this [Location](https://developer.android.com/reference/android/location/Location.html).\n\nThis method allows to use destructuring declarations when working with [Location](https://developer.android.com/reference/android/location/Location.html), for example: \n\n```kotlin\nval (lat, lon) = myLocation\n```"]]