以编程方式打开在Android /关闭GPS
问题描述:
可能重复:结果
启用GPS编程像塔斯克
是否有可能以编程方式打开/关闭GPS在Android?正是在这个岗位SO提到:启用GPS编程像塔斯克的,它不能做未经用户同意的。
Is it possible to programmatically turn on/off gps on android? It is mentioned on this SO post: Enable GPS programatically like Tasker that it cannot be done without the user consent.
答
没有是不可能的。你可以得到最接近的是发射一个Intent,显示GPS设置给用户。请按照本指南:指南GPS意图的Android
No it is not possible. The closest you can get is firing an Intent that shows the GPS settings to the user. Please follow this guide: Guide for GPS intent Android