-
class PermissionHandler
-
-
Field Summary
Fields Modifier and Type Field Description private int
lastRequestCode
-
Constructor Summary
Constructors Constructor Description PermissionHandler()
-
Method Summary
Modifier and Type Method Description boolean
isPermissionGranted(Activity activity, String permission)
Checks if the given Android Manifest Permission has been granted by the user to this application before. boolean
areAllPermissionsGranted(Activity activity, Array<String> permissions)
Checks if the given Android Manifest Permissions have been granted by the user to this application before. List<String>
requestPermissions(Activity activity, Array<String> permissions, int requestCode)
Starts the request of the given Android Manifest Permissions. List<String>
parseRequestResult(int requestCode, Array<String> permissions, Array<int> grantResults)
Called when there is a new response for a Android Manifest Permission request int
getLastRequestCode()
-
-
Method Detail
-
isPermissionGranted
boolean isPermissionGranted(Activity activity, String permission)
Checks if the given Android Manifest Permission has been granted by the user to this application before.
- Parameters:
activity
- the caller activitypermission
- to check availability for
-
areAllPermissionsGranted
boolean areAllPermissionsGranted(Activity activity, Array<String> permissions)
Checks if the given Android Manifest Permissions have been granted by the user to this application before.
- Parameters:
activity
- the caller activitypermissions
- to check availability for
-
requestPermissions
List<String> requestPermissions(Activity activity, Array<String> permissions, int requestCode)
Starts the request of the given Android Manifest Permissions.
- Parameters:
activity
- the caller activitypermissions
- to request to the userrequestCode
- to use with this request
-
parseRequestResult
List<String> parseRequestResult(int requestCode, Array<String> permissions, Array<int> grantResults)
Called when there is a new response for a Android Manifest Permission request
- Parameters:
requestCode
- received.permissions
- the Android Manifest Permissions that were requestedgrantResults
- the grant result for each permission
-
getLastRequestCode
int getLastRequestCode()
-
-
-
-