You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PermissionsDispatcher provides simple annotation-based API to handle runtime permissions in Android M.
7
+
PermissionsDispatcher provides simple annotation-based API to handle runtime permissions in Marshmallow.
8
8
9
-
[Runtime permissions](https://developer.android.com/preview/features/runtime-permissions.html) is so great for users but also the hell for developers. Actually I don't want to write such a complicated [code](https://github.com/googlesamples/android-RuntimePermissions/blob/master/Application/src/main/java/com/example/android/system/runtimepermissions/MainActivity.java) anymore.
9
+
[Runtime permissions](https://developer.android.com/preview/features/runtime-permissions.html) is so great for users but also the hell for developers.
10
10
11
11
You can be released from the burden that writing a bunch of check statements whether a permission have been granted or not.
12
12
@@ -16,11 +16,13 @@ Here's a minimum example that you register `MainActivity` which requires `Manife
16
16
17
17
### 1. Attach annotations
18
18
19
-
There are only 3 annotations.
19
+
There are only few annotations.
20
20
21
21
-`@RuntimePermissions`: [Must] Register an Activity or Fragment to handle permissions.
22
22
-`@NeedsPermission`: [Must] Register a method which the permission is needed.
23
+
- You can use `@NeedsPermissions` for multiple requests.
23
24
-`@ShowsRationale`: [Option] Register a method which explains why the permission is needed. Actually an annotated method is called when `shouldShowRequestPermissionRationale` returns true or when uer deny a permission.
25
+
- You can use `@ShowsRationales` for multiple requests.
24
26
25
27
> NOTE: Annotated methods must be package private or above.
0 commit comments