开发者

Turn on GPS inside the code [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Enable GPS program开发者_如何学Catically like Tasker

I would like to know how to turn on the GPS inside the code ? someone says you cannot and other says you can, I get confused Pleas help me,


Turning the GPS on requires user interaction as a security measure. If any application were able to turn the GPS on without the user knowing, that would be a very big privacy concern.

You can launch an Intent that takes the user to the GPS screen to turn it on / off.

startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜