-
public class PermissionsHelper class for handling runtime permissions. Created on 6/11/2017 on 9:32 PM
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPermissions.OptionsOptions to customize while requesting permissions.
-
Method Summary
Modifier and Type Method Description static voiddisableLogging()Disable logs. static voidcheck(Context context, String permission, String rationale, PermissionHandler handler)Check/Request a permission and call the callback methods of permission handler accordingly. static voidcheck(Context context, String permission, int rationaleId, PermissionHandler handler)Check/Request a permission and call the callback methods of permission handler accordingly. static voidcheck(Context context, Array<String> permissions, String rationale, Permissions.Options options, PermissionHandler handler)Check/Request permissions and call the callback methods of permission handler accordingly. static voidcheck(Context context, Array<String> permissions, int rationaleId, Permissions.Options options, PermissionHandler handler)Check/Request permissions and call the callback methods of permission handler accordingly. -
-
Method Detail
-
disableLogging
static void disableLogging()
Disable logs.
-
check
static void check(Context context, String permission, String rationale, PermissionHandler handler)
Check/Request a permission and call the callback methods of permission handler accordingly.
- Parameters:
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 showingthe rationale dialog.handler- The permission handler object for handling callbacks of various useractions such as permission granted, permission denied, etc.
-
check
static void check(Context context, String permission, int rationaleId, PermissionHandler handler)
Check/Request a permission and call the callback methods of permission handler accordingly.
- Parameters:
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 hasdenied permission earlier.handler- The permission handler object for handling callbacks of various useractions such as permission granted, permission denied, etc.
-
check
static void check(Context context, Array<String> permissions, String rationale, Permissions.Options options, PermissionHandler handler)
Check/Request permissions and call the callback methods of permission handler accordingly.
- Parameters:
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 showingthe rationale dialog.options- The options for handling permissions.handler- The permission handler object for handling callbacks of various useractions such as permission granted, permission denied, etc.
-
check
static void check(Context context, Array<String> permissions, int rationaleId, Permissions.Options options, PermissionHandler handler)
Check/Request permissions and call the callback methods of permission handler accordingly.
- Parameters:
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 hasdenied permission earlier.options- The options for handling permissions.handler- The permission handler object for handling callbacks of various useractions such as permission granted, permission denied, etc.
-
-
-
-