0

In gms.location.FusedLocationProviderApi, the way to check if location settings are enabled is to call checkLocationSettings. That's great for polling, but it's possible for the user to turn location on/off using the new Quick Settings menu (swipe down from top), which does not necessarily trigger onResume in the top activity (if location is turned on, there's a dialog, but if it's turned off, there isn't one).

What's the right way to get notified when a Quick Setting toggles Location?

Sofi Software LLC
  • 3,879
  • 1
  • 36
  • 34

1 Answers1

2

And the answer is... android.location.PROVIDERS_CHANGED is broadcast when a change is made to location in Quick Settings.

    <receiver
        android:name=".LocationProvidersChangedReceiver"
        >
        <intent-filter>
            <action android:name="android.location.PROVIDERS_CHANGED" />
        </intent-filter>
    </receiver>
Sofi Software LLC
  • 3,879
  • 1
  • 36
  • 34