EasyPermissions

object EasyPermissions

Utility to request and check System permissions for apps targeting Android M (API >= 23).

Types

PermissionCallbacks
Link copied to clipboard
Callback interface to receive the results of EasyPermissions.requestPermissions() calls.
RationaleCallbacks
Link copied to clipboard
interface RationaleCallbacks
Callback interface to receive button clicked events of the rationale dialog

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
hasPermissions
Link copied to clipboard
fun hasPermissions(context: Context?, vararg perms: String): Boolean
Check if the calling context has a set of permissions.
onRequestPermissionsResult
Link copied to clipboard
fun onRequestPermissionsResult(requestCode: Int, permissions: Array<out String>, grantResults: IntArray, vararg receivers: Any)
Handle the result of a permission request, should be called from the calling Activity's ActivityCompat.OnRequestPermissionsResultCallback.onRequestPermissionsResult method.
permissionPermanentlyDenied
Link copied to clipboard
fun permissionPermanentlyDenied(host: Activity, deniedPerms: String): Boolean
Check if a permission has been permanently denied (user clicked "Never ask again").
fun permissionPermanentlyDenied(host: Fragment, deniedPerms: String): Boolean
requestPermissions
Link copied to clipboard
fun requestPermissions(host: Activity, request: PermissionRequest)
Request a set of permissions.
fun requestPermissions(host: Fragment, request: PermissionRequest)
Request a set of permissions.
fun requestPermissions(host: Activity, rationale: String, requestCode: Int, vararg perms: String)
Request a set of permissions, showing a rationale if the system requests it.
fun requestPermissions(host: Fragment, rationale: String, requestCode: Int, vararg perms: String)
Request permissions from a Support Fragment with standard OK/Cancel buttons.
somePermissionDenied
Link copied to clipboard
fun somePermissionDenied(host: Activity, vararg perms: String): Boolean
See if some denied permission has been permanently denied.
fun somePermissionDenied(host: Fragment, vararg perms: String): Boolean
somePermissionPermanentlyDenied
Link copied to clipboard
fun somePermissionPermanentlyDenied(host: Activity, deniedPerms: List<String>): Boolean
Check if at least one permission in the list of denied permissions has been permanently denied (user clicked "Never ask again").
fun somePermissionPermanentlyDenied(host: Fragment, deniedPerms: List<String>): Boolean
toString
Link copied to clipboard
open fun toString(): String