Answers for "dexter permission android"

1

dexter dependency

dependencies{
    implementation 'com.karumi:dexter:6.2.2'
}
Posted by: Guest on November-23-2020
0

dexter permission android

if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
            Dexter.withContext(getApplicationContext()).withPermission(Manifest.permission.READ_EXTERNAL_STORAGE).withListener(new PermissionListener() {
                @Override
                public void onPermissionGranted(PermissionGrantedResponse permissionGrantedResponse) {

                }

                @Override
                public void onPermissionDenied(PermissionDeniedResponse permissionDeniedResponse) {
                    Toast.makeText(getApplicationContext(), "We can't continue without Permission", Toast.LENGTH_SHORT).show();
                }

                @Override
                public void onPermissionRationaleShouldBeShown(PermissionRequest permissionRequest, PermissionToken permissionToken) {
                    permissionToken.continuePermissionRequest();
                }
            }).check();
        }
Posted by: Guest on June-11-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language