public class Permissions
extends java.lang.Object
Helper class for handling runtime permissions. Created on 6/11/2017 on 9:32 PM
| Modifier and Type | Class and Description |
|---|---|
static class |
Permissions.Options
Options to customize while requesting permissions.
|
| Constructor and Description |
|---|
Permissions() |
| Modifier and Type | Method and Description |
|---|---|
static void |
check(android.content.Context context,
java.lang.String[] permissions,
int rationaleId,
Permissions.Options options,
PermissionHandler handler)
Check/Request permissions and call the callback methods of permission handler accordingly.
|
static void |
check(android.content.Context context,
java.lang.String[] permissions,
java.lang.String rationale,
Permissions.Options options,
PermissionHandler handler)
Check/Request permissions and call the callback methods of permission handler accordingly.
|
static void |
check(android.content.Context context,
java.lang.String permission,
int rationaleId,
PermissionHandler handler)
Check/Request a permission and call the callback methods of permission handler accordingly.
|
static void |
check(android.content.Context context,
java.lang.String permission,
java.lang.String rationale,
PermissionHandler handler)
Check/Request a permission and call the callback methods of permission handler accordingly.
|
static void |
disableLogging()
Disable logs.
|
public static void disableLogging()
public static void check(android.content.Context context,
java.lang.String permission,
java.lang.String rationale,
PermissionHandler handler)
context - the android context.permission - the permission to be requested.rationale - Explanation to be shown to user if s/he has denied permission earlier.
If this parameter is null, permissions will be requested without showing
the rationale dialog.handler - The permission handler object for handling callbacks of various user
actions such as permission granted, permission denied, etc.public static void check(android.content.Context context,
java.lang.String permission,
int rationaleId,
PermissionHandler handler)
context - the android context.permission - the permission to be requested.rationaleId - The string resource id of the explanation to be shown to user if s/he has
denied permission earlier. If resource is not found, permissions will be
requested without showing the rationale dialog.handler - The permission handler object for handling callbacks of various user
actions such as permission granted, permission denied, etc.public static void check(android.content.Context context,
java.lang.String[] permissions,
java.lang.String rationale,
Permissions.Options options,
PermissionHandler handler)
context - Android context.permissions - The array of one or more permission(s) to request.rationale - Explanation to be shown to user if s/he has denied permission earlier.
If this parameter is null, permissions will be requested without showing
the rationale dialog.options - The options for handling permissions.handler - The permission handler object for handling callbacks of various user
actions such as permission granted, permission denied, etc.public static void check(android.content.Context context,
java.lang.String[] permissions,
int rationaleId,
Permissions.Options options,
PermissionHandler handler)
context - Android context.permissions - The array of one or more permission(s) to request.rationaleId - The string resource id of the explanation to be shown to user if s/he has
denied permission earlier. If resource is not found, permissions will be
requested without showing the rationale dialog.options - The options for handling permissions.handler - The permission handler object for handling callbacks of various user
actions such as permission granted, permission denied, etc.