Android: Check if Location Services Enabled using Fused Location Provider

前端 未结 5 664
囚心锁ツ
囚心锁ツ 2021-01-31 10:59

According to the Android documentation:

The Google Location Services API, part of Google Play Services, provides a more powerful, high-level framework t

5条回答
  •  温柔的废话
    2021-01-31 11:31

    You can also check like this:

    LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);
    boolean isEnabled = service.isProviderEnabled(LocationManager.GPS_PROVIDER);
    

提交回复
热议问题