# Print output for @column tags ?>
public
interface
LocationListener
android.location.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 LocationManager#requestLocationUpdates(String, long, float, LocationListener)
method.
For more information about identifying user location, read the Obtaining User Location developer guide.
Public methods | |
---|---|
abstract
void
|
onLocationChanged(Location location)
Called when the location has changed. |
default
void
|
onProviderDisabled(String provider)
Called when the provider is disabled by the user. |
default
void
|
onProviderEnabled(String provider)
Called when the provider is enabled by the user. |
default
void
|
onStatusChanged(String provider, int status, Bundle extras)
This method is deprecated. This callback will never be invoked on Android Q and above. |
public abstract void onLocationChanged (Location location)
Called when the location has changed.
Parameters | |
---|---|
location |
Location : the updated location
This value cannot be null . |
public void onProviderDisabled (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.
Parameters | |
---|---|
provider |
String : the name of the location provider that has become disabled
This value cannot be null . |
public void onProviderEnabled (String provider)
Called when the provider is enabled by the user.
Parameters | |
---|---|
provider |
String : the name of the location provider that has become enabled
This value cannot be null . |
public void onStatusChanged (String provider, int status, Bundle extras)
This method is deprecated.
This callback will never be invoked on Android Q and above.
This callback will never be invoked on Android Q and above, and providers can be considered
as always in the LocationProvider#AVAILABLE
state.
Parameters | |
---|---|
provider |
String |
status |
int |
extras |
Bundle |