Stay organized with collections
Save and categorize content based on your preferences.
GeocodeListener
interface GeocodeListener
A listener for asynchronous geocoding results. Only one of the methods will ever be invoked per geocoding attempt. There are no guarantees on how long it will take for a method to be invoked, nor any guarantees on the format or availability of error information.
Summary
Public methods |
open Unit |
Invoked when geocoding fails, with an optional error message.
|
abstract Unit |
Invoked when geocoding completes successfully.
|
Public methods
onError
open fun onError(errorMessage: String?): Unit
Invoked when geocoding fails, with an optional error message.
Parameters |
errorMessage |
String?: This value may be null . |
onGeocode
abstract fun onGeocode(addresses: MutableList<Address!>): Unit
Invoked when geocoding completes successfully. May return an empty list.
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-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Geocoder.GeocodeListener\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nGeocodeListener\n===============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/location/Geocoder.GeocodeListener \"View this page in Java\") \n\n```\ninterface GeocodeListener\n```\n\n|------------------------------------------------|\n| [android.location.Geocoder.GeocodeListener](#) |\n\nA listener for asynchronous geocoding results. Only one of the methods will ever be invoked per geocoding attempt. There are no guarantees on how long it will take for a method to be invoked, nor any guarantees on the format or availability of error information.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](#onError(kotlin.String))`(`errorMessage:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?`)` Invoked when geocoding fails, with an optional error message. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onGeocode](#onGeocode(kotlin.collections.MutableList))`(`addresses:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[Address](/reference/kotlin/android/location/Address)!\u003e`)` Invoked when geocoding completes successfully. |\n\nPublic methods\n--------------\n\n### onError\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onError(errorMessage: String?): Unit\n```\n\nInvoked when geocoding fails, with an optional error message.\n\n| Parameters ||\n|----------------|--------------------------------------------------------------------------------------------------------------|\n| `errorMessage` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?: This value may be `null`. |\n\n### onGeocode\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onGeocode(addresses: MutableList\u003cAddress!\u003e): Unit\n```\n\nInvoked when geocoding completes successfully. May return an empty list.\n\n| Parameters ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `addresses` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[Address](/reference/kotlin/android/location/Address)!\\\u003e: This value cannot be `null`. |"]]