Skip to content

Instantly share code, notes, and snippets.

@hichamboushaba
Created November 16, 2021 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hichamboushaba/5413ac2a1bda575acf5c6945ffd73083 to your computer and use it in GitHub Desktop.
Save hichamboushaba/5413ac2a1bda575acf5c6945ffd73083 to your computer and use it in GitHub Desktop.
class MyViewModel(private val permissionManager: PermissionManager): ViewModel() {
fun onButtonClicked() {
viewModelScope.launch {
val permissionStatus = permissionManager.requestPermission(Manifest.permission.ACCESS_FINE_LOCATION)
// handle the result
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment