3

I try to open the permission manager screen from the settings but I don't found the good Intent.

I try :

startActivity(Intent(Settings.ACTION_PRIVACY_SETTINGS))

But it open the Privacy page of the settings and if I want to show the permission manager screen, I have to click on the sub-element "Permission manager" : enter image description here

I want to open this page : enter image description here

How can I do ?

Jéwôm'
  • 3,753
  • 5
  • 40
  • 73

3 Answers3

1

I think it is not possible to directly access privacy -> permission manager. Here are all actions that you can access. https://developer.android.com/reference/android/provider/Settings

1

You can't open permissions page directly. However, you can use Intents to open the app's settings screen, from which, you can open the permission settings with one click:

Kotlin:

startActivity(Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS).apply {
    data = Uri.fromParts("package", packageName, null)
})

Java:

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

cr: How to programmatically open the Permission Screen for a specific app on Android Marshmallow?

kRiZ
  • 2,320
  • 4
  • 28
  • 39
0

It isn't possible to open settings for permissions, reason is defined in this link https://stackoverflow.com/a/52759143/5890471

However you can take permissions from the user in a traditional way by:

ActivityCompat.requestPermissions(this, new String[]{permissionName}, permissionRequestCode);

and define your required permissions in manifest!

blackgreen
  • 34,072
  • 23
  • 111
  • 129