FileDocCategorySizeDatePackage
LocationListener.javaAPI DocAndroid 5.1 API3344Thu Mar 12 22:22:30 GMT 2015android.location

LocationListener

public interface LocationListener
Used for receiving notifications from the LocationManager when the location has changed. These methods are called if the LocationListener has been registered with the location manager service using the {@link LocationManager#requestLocationUpdates(String, long, float, LocationListener)} method.

Developer Guides

For more information about identifying user location, read the Obtaining User Location developer guide.

Fields Summary
Constructors Summary
Methods Summary
public voidonLocationChanged(Location location)
Called when the location has changed.

There are no restrictions on the use of the supplied Location object.

param
location The new location, as a Location object.

public voidonProviderDisabled(java.lang.String provider)
Called when the provider is disabled by the user. If requestLocationUpdates is called on an already disabled provider, this method is called immediately.

param
provider the name of the location provider associated with this update.

public voidonProviderEnabled(java.lang.String provider)
Called when the provider is enabled by the user.

param
provider the name of the location provider associated with this update.

public voidonStatusChanged(java.lang.String provider, int status, android.os.Bundle extras)
Called when the provider status changes. This method is called when a provider is unable to fetch a location or if the provider has recently become available after a period of unavailability.

param
provider the name of the location provider associated with this update.
param
status {@link LocationProvider#OUT_OF_SERVICE} if the provider is out of service, and this is not expected to change in the near future; {@link LocationProvider#TEMPORARILY_UNAVAILABLE} if the provider is temporarily unavailable but is expected to be available shortly; and {@link LocationProvider#AVAILABLE} if the provider is currently available.
param
extras an optional Bundle which will contain provider specific status variables.

A number of common key/value pairs for the extras Bundle are listed below. Providers that use any of the keys on this list must provide the corresponding value as described below.

  • satellites - the number of satellites used to derive the fix