开发者

Turn on GPS inside the code [duplicate]

开发者 https://www.devze.com 2023-03-31 09:36 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Enable GPS program开发者_如何学Catically like Tasker
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

精彩评论

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