I'm testing out a Broadcast Receiver and printing the state of GPS in my logs to get a feel for if it works as intended, and I found some odd behavior (maybe it isn't odd, but I didn't expect it.)
Whenever one toggled GPS, if it was the first time in a while, it'll take a while for the BroadcastReceiver to receive the event, and when it does, it fires off many times (around 10). After that, when one toggles it on and off, it gets fired off twice each time.
Why is this?
This is what I have in my manifest:
<receiver android:name=".receivers.GpsLocationReceiver" >
<intent-filter>
<action android:name="android.location.PROVIDERS_CHANGED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>