0

即使在配置中被禁用,您能否从应用程序(用户权限)激活 android 上的定位服务?

4

1 回答 1

2

没有。但是您可以检查它是否已启用并打开设置以防万一:

LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
boolean isEnabled = locationManager.isProviderEnabled (LocationManager.GPS_PROVIDER);
  if (!isEnabled){

startActivityForResult(new   Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0);
 }
于 2013-01-13T02:27:48.630 回答