Force GPS to come on

こ雲淡風輕ζ 提交于 2019-12-11 19:35:15

问题


I asked this question (Why Does Map Marker Lurch Around The Map) yesterday. One thing I noticed today is that for an activity that uses LocationManager, but not a map I get the GPS icon (satalite dish beaming signals up) in the status tray. With the activity that has a map fragment and also uses LocationManager I do not get the GPS icon in the tray. I copied and pasted the location manager code from one activity to the other.

Why would the GPS come on some times and not others?

Greg


回答1:


It depend on global GPS setting - if it's globally on, using LocationManager in your Activity\Fragment will fire "satellite dish". If GPS is globally switched off - using LocationManager will not fire.

The reason is that GPS is a huge power consumerist, and allowing it to run without clear user decision to switch it on will drain the device battery extremely quickly.



来源:https://stackoverflow.com/questions/30833628/force-gps-to-come-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!