Added in API level 33

GeocodeListener


interface 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
open Unit
onError(errorMessage: String?)

Invoked when geocoding fails, with an optional error message.

abstract Unit

Invoked when geocoding completes successfully.

Public methods

onError

Added in API level 33
open fun onError(errorMessage: String?): Unit

Invoked when geocoding fails, with an optional error message.

Parameters
errorMessage String?: This value may be null.

onGeocode

Added in API level 33
abstract fun onGeocode(addresses: MutableList<Address!>): Unit

Invoked when geocoding completes successfully. May return an empty list.

Parameters
addresses MutableList<Address!>: This value cannot be null.