如何切换 ConnectivityManager.getBackgroundDataSetting() 返回的选项?
有人看过 jsharkey 的 Google io 电池寿命演示< /a>?
如何切换模拟器中 ConnectivityManager.getBackgroundDataSetting()
返回的选项?
Did anybody watch jsharkey's battery life google io presentation ?
How does one toggle the option returned by ConnectivityManager.getBackgroundDataSetting()
in the emulator ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短的回答是你不能。
更长的答案是你不应该。它是安全设置之一,因此应该不能直接被操纵。
上面链接中的文档指出:
最简单的方法是使用 SYNC_SETTINGS 操作将用户指向正确的设置活动:
这很可能会破坏应用程序的流程,但会确保用户了解设置的更改。
The short answer is you can't.
The longer answer is you shouldn't. It is one of the secure settings, and as such shouldn't be manipulated directly.
The docs in the link above state:
The easiest way to do this is to point the user to the correct settings activity, using the
SYNC_SETTINGS
action:This is most likely to break the flow of your app, but will make sure the user is aware of the change to the settings.