Permissionsdispatcher: How to do for multiple permissions for specific function?

Created on 2 Aug 2017  路  3Comments  路  Source: permissions-dispatcher/PermissionsDispatcher

@NeedsPermission(Manifest.permission.CAMERA) @NeedsPermission(Manifest.permission.READ_EXTERNAL_STORAGE) void myFunction() { ... }

As you can see, I need 2 permissions allowed to call this function.
Please give your advice.
Thanks.

Most helpful comment

Our annotations accept arrays as their parameter, so you'd specify multiple permissions in the same annotation like so:

@NeedsPermission({Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE})

All 3 comments

Our annotations accept arrays as their parameter, so you'd specify multiple permissions in the same annotation like so:

@NeedsPermission({Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE})

Thanks.

Thx!

Was this page helpful?
0 / 5 - 0 ratings