Frederik Schweiger Frederik Schweiger - 8 months ago 259
Android Question

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

I have a question regarding the new Android Marshmallow release:

Is it achievable to display the Permission Screen for a specific app via an Intent or something similar?

Android M Permission Screen

It's possible to display the app settings with the following code - is there an analog solution for directly opening the Permission Screen?

startActivity(new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
Uri.fromParts("package", getPackageName(), null)));

I already did some research on this but I wasn't able to find a proper solution - I would appreciate every help!


This is not possible. I tried to do so, too. I could figure out the package name and the activity which will be started. But in the end you will get a security exception because of a missing permission you can't declare.


Regarding the other answer I also recommend to open the App settings screen. I do this with the following code:

    public static void startInstalledAppDetailsActivity(final Activity context) {
    if (context == null) {
    final Intent i = new Intent();
    i.setData(Uri.parse("package:" + context.getPackageName()));

As I don't want to have this in my history stack I remove it using intent flags.