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已被弃用。官方推荐使用Google Location Services API,但这仅适用于设备拥有Google服务的情况。不幸的是,我的设备没有安装Google服务,有其他替代方案吗?