PermissionsKt
PermissionsKt copied to clipboard
Ask on fragment
Will be available ask for permissions on fragment?
You can do it like this
activity?.askPermissions(Manifest.permission.WRITE_EXTERNAL_STORAGE)
That sends the result to the activity, not back to the fragment.
Yes my friend @CMircea , but we still get the PermissionCallbacks
activity?.askPermissions(Manifest.permission.CAMERA) {
onGranted {
here..
}
....
}
i already use it.
Update i forgot about this. Dont forget add code below at your activity
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
handlePermissionsResult(requestCode,permissions,grantResults)
}