【发布时间】:2015-11-13 04:40:02
【问题描述】:
有一个关于它的老问题 (Toggle gps on root devices on Android)....
我真的需要在没有任何通知的情况下使用 su 命令启用 GPS ... 我的代码在上面:
public static void turnOnGPS(){
try {
String mCommand = "adb shell settings put secure location_providers_allowed gps,network,wifi ";
Shell.runAsRoot(mCommand);
Utilities.log("GPS Actioned.");
}catch (Exception o){
Utilities.log(o.toString());
}
}
【问题讨论】: