onStatusChanged
Added in API level 1
Deprecated in API level 29
public void onStatusChanged (String provider,
int status,
Bundle extras)
This method was deprecated in API level 29.
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.
Note that this method only has a default implementation on Android R and above, and this method must still be overridden in order to run successfully on Android versions below R. LocationListenerCompat from the compat libraries may be used to avoid the need to override for older platforms.
onStatusChanged deprecated The Google Location Services API is officially recommended, but this can only be used if the device has Google Services. Unfortunately, my device does not have Google Services, so is there any other alternative?
I encountered this issue on devices below Android 10.
Here is the stack trace;
The unfortunate thing is, it didn't have a reference to any of my source, but it is evident it stems from location listener.
Looking through the docs here , it says:
The initial implementation was this way:
Changing it to the snippet below adds a strikethrough to the
super.onStatusChangedand still crashes because the docs says it was deprecated in API 29Removing
super.onStatusChanged(provider, status, extras)but leaving the overide ensures that the call is not propagated into the parent abstract class.