Check if 'Access to my location' is enabled - Android

android, gps, location

Solution

may be this will be useful check this site it discusses about location service

http://www.scotthelme.co.uk/android-location-services/

Problem

I have an android app that uses location. But I noticed that if users disable the 'Access to my location' in Settings > Location access, nothing works anymore. How can I check that it's enabled? In case it's disabled, how to open those settings from my app? Thanks SOLVED : ``` String locationProviders = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED); if (locationProviders == null || locationProviders.equals("")) { ... startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)); } ```

Original source