#StackBounty: #android #broadcastreceiver LocationManager.PROVIDERS_CHANGED_ACTION will not work on API 26 and higher

Bounty: 50

I am using following code to get location on/off event.

        <action android:name="android.location.PROVIDERS_CHANGED" />
        <category android:name="android.intent.category.DEFAULT" />

I am developing geofence based app. Based on Re-register geofences only when required we have to re register the geofences after the app has received a GEOFENCE_NOT_AVAILABLE alert. This typically happens after NLP (Android’s Network Location Provider) is disabled.

By using this broadcast receiver I re registered the geofences when Android’s Network Location Provider is enabled.

But From API level 26 this broadcast receiver will never work. Ref: Background Execution Limits.

So how can I achieve the same task in API 26 and higher?

Any solution/suggestion will be highly appreciated.

Note : I need to re register the geofences even app is in background.

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.