Created
November 22, 2014 14:07
-
-
Save tobiasstraub/7afaec14911df412bd8f to your computer and use it in GitHub Desktop.
Android: Check for GPS Provider is enabled, when not start Setting Activity to activate GPS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!((LocationManager) getSystemService(LOCATION_SERVICE)).isProviderEnabled(LocationManager.GPS_PROVIDER)) { | |
Toast.makeText(getApplicationContext(), R.string.activate_gps, Toast.LENGTH_LONG).show(); | |
startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment