Stay organized with collections
Save and categorize content based on your preferences.
Geocoder.GeocodeListener
public
static
interface
Geocoder.GeocodeListener
android.location.Geocoder.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 |
default
void
|
onError(String errorMessage)
Invoked when geocoding fails, with an optional error message.
|
abstract
void
|
onGeocode(List<Address> addresses)
Invoked when geocoding completes successfully.
|
Public methods
onError
public void onError (String errorMessage)
Invoked when geocoding fails, with an optional error message.
Parameters |
errorMessage |
String : This value may be null . |
onGeocode
public abstract void onGeocode (List<Address> addresses)
Invoked when geocoding completes successfully. May return an empty list.
Parameters |
addresses |
List : This value cannot be null . |
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](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nGeocoder.GeocodeListener\n========================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/location/Geocoder.GeocodeListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nGeocoder.GeocodeListener\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------|\n| android.location.Geocoder.GeocodeListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nA listener for asynchronous geocoding results. Only one of the methods will ever be invoked\nper geocoding attempt. There are no guarantees on how long it will take for a method to be\ninvoked, nor any guarantees on the format or availability of error information.\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` default void` | ` `[onError](/reference/android/location/Geocoder.GeocodeListener#onError(java.lang.String))`(`[String](/reference/java/lang/String)` errorMessage) ` Invoked when geocoding fails, with an optional error message. |\n| ` abstract void` | ` `[onGeocode](/reference/android/location/Geocoder.GeocodeListener#onGeocode(java.util.List\u003candroid.location.Address\u003e))`(`[List](/reference/java/util/List)`\u003c`[Address](/reference/android/location/Address)`\u003e addresses) ` Invoked when geocoding completes successfully. |\n\nPublic methods\n--------------\n\n### onError\n\nAdded in [API level 33](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void onError (String errorMessage)\n```\n\nInvoked when geocoding fails, with an optional error message.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|--------------------------------------------|\n| `errorMessage` | `String`: This value may be `null`. \u003cbr /\u003e |\n\n### onGeocode\n\nAdded in [API level 33](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onGeocode (List\u003cAddress\u003e addresses)\n```\n\nInvoked when geocoding completes successfully. May return an empty list.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|---------------------------------------------|\n| `addresses` | `List`: This value cannot be `null`. \u003cbr /\u003e |"]]