简体   繁体   English

如何? 对Android App进行编码以将用户的位置设置更改为OFF?

[英]How to? Code Android App to Change user's LOCATION SETTING to OFF?

quick Android Development question on how to Code something! 快速的Android开发有关如何编写代码的问题!
I've searched for it, but the results are always messy, so I cant seem to find what I need. 我已经搜索过了,但是结果总是混乱的,所以我似乎找不到我需要的东西。
Any help is greatly appreciated.. 任何帮助是极大的赞赏..

Question: 题:

How would I write the Code to: Turn the user's "Location" Setting to "OFF"..? 我将如何编写代码以:将用户的“位置”设置设为“关”。

For example, in the same way that all of the "settings toggle buttons" homescreen widgets would do it, I assume - although i'm implementing it differently than that. 例如,我以所有“设置切换按钮”主屏幕小部件都可以使用的方式相同,尽管我实现的方式与此不同。

I simply just need the raw code that turns LOCATION to OFF. 我只需要将LOCATION设置为OFF的原始代码即可。
Also , what permissions would I need to add in my Manifest? 另外 ,我需要在清单中添加哪些权限?

THANKS IN ADVANCE! 提前致谢! :) :)

How would I write the Code to: Turn the user's "Location" Setting to "OFF"..? 我将如何编写代码以:将用户的“位置”设置设为“关”。

You don't, except perhaps on rooted devices or as a system app (ie, pre-installed by the manufacturer). 您不需要,除非是在有根设备上或作为系统应用程序(即,由制造商预先安装)。 Ordinary apps have no ability to change the user's location settings directly. 普通应用无法直接更改用户的位置设置。

all of the "settings toggle buttons" homescreen widgets would do it 所有“设置切换按钮”主屏幕小部件都可以做到这一点

Only on rooted devices, or those that are supplied by the device manufacturer for their device. 仅在已root用户的设备上,或在设备制造商为其设备提供的设备上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用单选按钮更改 android 应用程序中的设置? - How change setting in android app using radiobutton? 怎么办? 监听位置设置被打开(Android 应用程序) - How to? Listen for Location Setting being turned ON (Android App) 如何创建与每个已安装的android应用相关联的活动(android类)的列表(文件名,位置)(在用户电话上)? - How can I create a list (file name, location) of activities (android classes) associated with each installed android app (on a user's phone)? Android Maps-如何将地图自动居中到用户的当前位置? - Android Maps - how to automatically center the map to the user's current location? 如何从Android中打开或关闭位置获取响应? - how to get the response from location on or off in android? 如何在Android应用程序中更改工具栏的标题? - How to change the toolbar's title in android app? 自动更改/指示Android应用程序的源代码 - Automatically change/instrument Android app's source code 从我的Android应用中关闭位置服务 - Turn off Location Services from my Android App 如何根据用户的输入使此代码循环? - How do I get this code to loop based off the user's input? 用户为 android 应用程序设置首选通知音 - User setting preferred notification tone for the android app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM