Skip to content

Instantly share code, notes, and snippets.

@gbzarelli
Last active February 24, 2018 14:17
Show Gist options
  • Save gbzarelli/f86d05c9465775fafe43b2fe5c41ea14 to your computer and use it in GitHub Desktop.
Save gbzarelli/f86d05c9465775fafe43b2fe5c41ea14 to your computer and use it in GitHub Desktop.
Como saber o modo de configuração do GPS
val locationMode = Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCATION_MODE);
when (locationMode) {
Settings.Secure.LOCATION_MODE_OFF -> {/*TODO*/}
Settings.Secure.LOCATION_MODE_HIGH_ACCURACY ->{/*TODO*/}
Settings.Secure.LOCATION_MODE_BATTERY_SAVING -> {/*TODO*/}
Settings.Secure.LOCATION_MODE_SENSORS_ONLY -> {/*TODO*/}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment