Skip to content

Instantly share code, notes, and snippets.

@fredchung
Last active September 7, 2020 06:06
Show Gist options
  • Save fredchung/b07d2bec79a55c4e9cca18dd149bc829 to your computer and use it in GitHub Desktop.
Save fredchung/b07d2bec79a55c4e9cca18dd149bc829 to your computer and use it in GitHub Desktop.
Do not request foreground and background location permissions together (ActivityCompat or Framework APIs)
requestPermissions(
arrayOf(
// Do not request foreground and background location permissions together,
// as they will be ignored along with any other permissions in the request.
// Request location permissions incrementally instead.
android.Manifest.permission.ACCESS_COARSE_LOCATION,
android.Manifest.permission.ACCESS_BACKGROUND_LOCATION,
...)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment