Created
May 27, 2021 08:24
-
-
Save mizutori/d06c264b61f4eddb6eda0a4652be0d97 to your computer and use it in GitHub Desktop.
Revisions
-
mizutori created this gist
May 27, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ override fun onStatusChanged(provider: String?, status: Int, extras: Bundle?) { if (provider == LocationManager.GPS_PROVIDER) { if (status == LocationProvider.OUT_OF_SERVICE) { notifyLocationProviderStatusUpdated(false) } else { notifyLocationProviderStatusUpdated(true) } } } override fun onProviderEnabled(provider: String?) { if (provider == LocationManager.GPS_PROVIDER) { notifyLocationProviderStatusUpdated(true) } } override fun onProviderDisabled(provider: String?) { if (provider == LocationManager.GPS_PROVIDER) { notifyLocationProviderStatusUpdated(false) } } private fun notifyLocationProviderStatusUpdated(isLocationProviderAvailable: Boolean) { //Broadcast location provider status change here }