File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
app/src/main/java/com/vishalpvijayan/androidruntimepermission Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -58,21 +58,26 @@ public void onPermissionDenied(PermissionDeniedResponse permissionDeniedResponse
5858 public void onPermissionRationaleShouldBeShown (PermissionRequest permissionRequest , PermissionToken permissionToken ) {
5959 permissionToken .continuePermissionRequest ();
6060 }
61- });
61+ }). check () ;
6262 break ;
6363 case R .id .btnMultiplePermission :
6464 Dexter .withContext (MainActivity .this ).withPermissions (Manifest .permission .READ_EXTERNAL_STORAGE ,
6565 Manifest .permission .WRITE_EXTERNAL_STORAGE ).withListener (new MultiplePermissionsListener () {
6666 @ Override
6767 public void onPermissionsChecked (MultiplePermissionsReport multiplePermissionsReport ) {
68-
68+ if (multiplePermissionsReport .areAllPermissionsGranted ()){
69+ Toast .makeText (MainActivity .this , "All permission Granted" , Toast .LENGTH_SHORT ).show ();
70+ }
71+ else {
72+ Toast .makeText (MainActivity .this , "Please Grant all the permission" , Toast .LENGTH_SHORT ).show ();
73+ }
6974 }
7075
7176 @ Override
7277 public void onPermissionRationaleShouldBeShown (List <PermissionRequest > list , PermissionToken permissionToken ) {
7378
7479 }
75- });
80+ }). check () ;
7681 break ;
7782 }
7883 }
You can’t perform that action at this time.
0 commit comments