Skip to content

Instantly share code, notes, and snippets.

@hichamboushaba
Last active November 16, 2021 14:15
Show Gist options
  • Save hichamboushaba/008915a02929205b72f284d5418aecd6 to your computer and use it in GitHub Desktop.
Save hichamboushaba/008915a02929205b72f284d5418aecd6 to your computer and use it in GitHub Desktop.
private val locationPermissionLauncher =
registerForActivityResult(ActivityResultContracts.RequestPermission()) {
viewModel.onPermissionGranted(
granted = it,
shouldShowRationale = shouldShowRequestPermissionRationale(Manifest.permission.ACCESS_FINE_LOCATION)
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment