Added in API level 33

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

Added in API level 33
public void onError (String errorMessage)

Invoked when geocoding fails, with an optional error message.

Parameters
errorMessage String: This value may be null.

onGeocode

Added in API level 33
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.