Created
May 27, 2021 08:24
-
-
Save mizutori/d06c264b61f4eddb6eda0a4652be0d97 to your computer and use it in GitHub Desktop.
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 characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment