The app that I'm writing uses the GPS location manager service requestLocationUpdates() but I would like to be able to change the min Time and min Distance parameters throughout the program. I initialize the location listener on creation but I can't figure out how to change these parameters or even find out if it's possible to do that. The main purpose for this would be to conserve battery life when the program doesn't need regular position updates. Thanks so much for your help! -Dom
相关问题
- 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'm not sure if this is correct, but faced with the same problem, I occasionally remove the LocationListener and then later add it back with a different refresh interval:
Unfortunately the requestLocationUpdates() method keeps the gps on until removeUpdates() is called. In the end I used a timer to request a location and immediately removeUpdates() every minute (to conserve battery).