1

I'm using RxPermissions to handle permissions in my Android app. For example I have the following code inside a button's onClickListener

Disposable mDispo = new RxPermissions(this)
            .request(Manifest.permission.READ_CALENDAR, Manifest.permission.WRITE_CALENDAR)
            .subscribe(isAllowed -> {
                if (isAllowed) {
                    setResult(RESULT_OK);
                    finish();
                } else ExtensionsKt.showPermisionRequiredDialog(this);
            });

When the button is pressed it will show the following dialog.

enter image description here

But If I check the Don't ask again option and press DENY, the dialog will not appear again and the user is pretty much stuck until he changes the permission from the app settings.

For that I made a custom dialog that will be triggered when isAllowed is false but now the problem is that the custom dialog will appear even if the user doesn't check the Don't ask again checkbox, just by simply pressing DENY.

How can I make the custom dialog appear at the next button click only if the user has checked the Don't ask again option previously?

petrrr33
  • 583
  • 9
  • 24
  • What is lifecycle of the subscription? When does it unsubscribe? – Onik Jun 04 '19 at 15:52
  • _"the custom dialog will appear just by simply pressing DENY"_ Isn't it what you wanted? – Onik Jun 04 '19 at 16:02
  • if the `Don't ask again` checkbox is checked and you press `DENY` the next time you tap on the button, the dialog in the image will not appear anymore. That's when I want my custom dialog to show – petrrr33 Jun 05 '19 at 07:13

0 Answers0