开发者

Switch Android GPS programmatically [duplicate]

开发者 https://www.devze.com 2023-02-23 02:45 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How can I enable or disable the GPS programmatically on Android?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How can I enable or disable the GPS programmatically on Android?

I have searching on how to toggle GPS programmatically, the standard answer is that it's not possible.

If this is really the case how do all the various power/togg开发者_JAVA技巧le related widgets manage to toggle GPS with one click and no warning. The market place is full of examples that show it is possible.

So how?


I've tested this on the emulator with 1.6 and it works.

How can I enable or disable the GPS programmatically on Android?

EDIT: This is not particularly allowed on the Android Market, and it stopped working as of android 2.3. I have also tested on a 2.1 emulator, and two actual devices with 2.2, and it worked on those.

0

精彩评论

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

关注公众号