RuntimePermissionRequest

class RuntimePermissionRequest(activity: Activity, permissions: Array<out String>, handler: RuntimePermissionHandler) : BasePermissionRequest, RuntimePermissionHandler.Listener

Implementation of BasePermissionRequest that checks the permissions since Android M. The checks on the permissions are delegated to the RuntimePermissionHandler provided to this request.

Parameters

activity

the Activity used to check the permissions status.

permissions

the set of permissions that must be checked.

handler

the RuntimePermissionHandler which all checks on permissions are delegated to.

Constructors

RuntimePermissionRequest
Link copied to clipboard
fun RuntimePermissionRequest(activity: Activity, permissions: Array<out String>, handler: RuntimePermissionHandler)

Functions

addListener
Link copied to clipboard
open override fun addListener(listener: PermissionRequest.Listener)

Adds a Listener which will be notified when the permissions request sent with send ends.

checkStatus
Link copied to clipboard
open override fun checkStatus(): List<PermissionStatus>

Checks the status of permissions of this request without sending it. Below API 23, this method and send should have the same behavior since the permissions status can be checked without sending a runtime request. Below API 23, the possible status are:

onPermissionsResult
Link copied to clipboard
open override fun onPermissionsResult(result: List<PermissionStatus>)

Notified when the permissions request ended and a status for each permission is available.

removeAllListeners
Link copied to clipboard
open override fun removeAllListeners()

Removes all the listeners added to this request.

removeListener
Link copied to clipboard
open override fun removeListener(listener: PermissionRequest.Listener)

Removes a Listener added with addListener which should not be notified anymore.

send
Link copied to clipboard
open override fun send()

Sends the PermissionRequest and performs the checks on its status. The result will be returned to the attached listeners.