启用 GPS 而不将用户转发到“设置”?
我知道这个问题以前曾以类似的形式被问过,但我没有找到关于以下问题的真正答案:
在我的 Nexus One 上,有一个小部件可以打开/关闭我手机上的一些功能,例如无线局域网、蓝牙、全球定位系统等。
为什么这个小部件是否可以访问 GPS,而不将我转到设置屏幕?
我如何在我自己的应用程序中使用此功能?
在许多网站上都提到,这样做是出于安全原因......但是以一种奇怪的方式,这个小部件可能会这样做?为什么?更好的问题是:如何?
有人有线索吗?
I know this question has been asked in similar forms before, but I found no real answer about the following issue:
On my Nexus One there's a widget to toggle on/off several things on my phone like wlan, bluetooth, gps,..
Why does this widget has access to the GPS, without forwarding me to the settings screen?
And how can I use this functionality in my own apps?
On many sites it is mentioned, this is done because of security reasons...but in a strage way, this widget may do this? why? and the better question is: how?
Does someone have a clue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因为该小部件是由固件作者开发的,也就是编写“设置”屏幕的人。
从 Android 1.5 开始,您不能这样做。对不起!
因为要求禁用 GPS 的用户不喜欢应用程序自行决定重新启用它。
Because the widget was developed by the firmware authors, the same people who wrote the Settings screen.
You can't, as of Android 1.5. Sorry!
Because users who ask for GPS to be disabled do not appreciate applications deciding on their own to re-enable it.