I tried an approach by using a BroadcastReceiver that listens for PROVIDERS_CHANGED action, but that only tells me when the location settings are turned on/off. I would like to know when the location services are being used to acquire a location by any application. I don't need to know which application is doing it, and I don't care for the location itself. I just want to know whenever some application tries to acquire a location, and when it stops doing that. Is this possible?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I don't know if you really need to be notified via broadcast receiver, but if it is not absolutely required then you can use GpsStatus.Listener :
Here is how to use it :
And if you really need to receive this info via BroadcastReceiver : just wrap this code in a Service and send the event from there.
Not precisely what you asked for but might be of interest: you can register for location updates from
PASSIVE_PROVIDER
throughLocationManager
.You won't be able to know when other apps stop requesting new locations, or when they start exactly, but you'll know when they receive one that they have requested.