Karumi / Dexter

Android library that simplifies the process of requesting permissions at runtime.
http://karumi.com
Apache License 2.0
5.23k stars 671 forks source link

not show custom dialog! #97

Closed mahdimortazavi closed 7 years ago

mahdimortazavi commented 7 years ago

Expected behaviour

show custom dialog with title , massage , ...

Actual behaviour

not show any custom dialog!!

Steps to reproduce

screenshot_1479633453

MainActivity

    MultiplePermissionsListener dialogMultiplePermissionsListener =
            DialogOnAnyDeniedMultiplePermissionsListener.Builder
                    .withContext(this)
                    .withTitle("Camera & audio permission")
                    .withMessage("Both camera and audio permission are needed to take pictures of your cat")
                    .withButtonText(android.R.string.ok)
                    .withIcon(android.R.drawable.ic_input_add)
                    .build();
    Dexter.checkPermissions(dialogMultiplePermissionsListener, Manifest.permission.CAMERA, Manifest.permission.READ_CONTACTS, Manifest.permission.RECORD_AUDIO);

MyApplication Class

@Override
public void onCreate() {
    super.onCreate();
    Dexter.initialize(getApplicationContext());
}

compileSdkVersion 25 buildToolsVersion "25.0.0" minSdkVersion 17 targetSdkVersion 25

Version of the library

compile 'com.karumi:dexter:2.3.1'

Serchinastico commented 7 years ago

Hi @mahdimortazavi

The dialog you are trying to display should only be shown if the user rejects the permission once. That's called a rationale.

The dialog in the screenshot is the native Android permission dialog and there is nothing anyone can do to avoid showing it, it's in the framework. I recommend you to read carefully the section of our README that explains this a little more in depth.

Cheers and thanks for reporting!