Android studio deep link to specific application permission settings

Viewed 792

I was wondering if there is a way to deep-link to app`s specific settings when asking for permission.

For example, I do the following to ask the user to grant accessibility permission.

Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
startActivity(intent);

The issue is that(And this is the case on Samsung S10 for example) That this takes me to general Accessibility page, after this the user still need to tap on installed Services button and then they need to find and tap on my application and only then they can grant the accessibility permission.

I was wondering if there is a way to shorten this and take them directly to my specific application accessibility granting page.

1 Answers

If you want open directly the settings of your app, you can use the next code:

    Intent intent = new Intent();
    intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    Uri uri = Uri.fromParts("package", "yourPackageName", null);
    intent.setData(uri);
    startActivity(intent);
Related