0

对于 Android 设备(4.0 或更高版本),是否可以使用 java 代码关闭/打开 GPS,而不是用户必须使用设置?

4

1 回答 1

1

After Android 2.3 it is no longer possible. Only apps signed with manufacturer platform certificate can use that permission.

The correct thing is to send the user to the location settings page, and let him enable GPS if he wish. e.g.,

Intent i = new
 Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(i);
于 2013-08-30T01:06:02.923 回答