开发者

How to enable the GPS setting automatic [duplicate]

开发者 https://www.devze.com 2023-01-16 22:53 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Enable GPS programatically like Tasker
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Enable GPS programatically like Tasker

Anybody know how to enable the GPS setting automatic? Seems the 开发者_开发技巧 "Toggle Settings" app can handle it, but I want to force open in my app sdk 2.1. some people said

 "Method m =locationManager.getClass().getMethod("updateProviders", new Class[] {});
                m.setAccessible(true);
                m.invoke(locationManager, new Object[]{});"

but in sdk2.1 locationManager class donot have updateProviders. couled you give me some directions or code?

Please help me if you have time.


Ordinary SDK applications cannot change the GPS enabled state. Only those signed by the firmware signing key can do this, via Settings.Secure.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号