I need my app monitor to hang or disconnect the GPS adapter. I donโt care about the actual GPS functions working in coin or not - I need the status of a GPS adapter.
I can do it manually: String providers = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED)
If "gps" is displayed, then it is active, otherwise not. But I canโt find the documentation on receiving a notification when the GPS is on or off by the user. I tried to use addGpsStatusListener in the LocationManager, but this only notifies when the actual GPS fix occurs (for example, if the Maps application is used).
Any ideas?
source
share