How to detect when user turn on/off gps state?
I want to block the user from changing WiFi, GPS and loading settings from my application. The user need not on/off WiFi and GPS while running my application.(From notification bar). Is there any BroadcastReceiver exist for listening GPS on/off? Well I did a lot of digging and found that addGpsStatusListener(gpsStatusListener) was deprecated in API 24. And for me, this didn't even work! So, here is another alternative solution to this. If in your app, you want to listen to the GPS state change (I mean On/Off by user) . Using a Broadcast surely is the best approach. Implementation: /** *