Android – How to programmatically open the permission screen for a specific app on Android 6.0 (Marshmallow)

androidandroid-6.0-marshmallowandroid-permissions

I have a question regarding the new Android 6.0 (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.

Best Answer

According to the official Marshmallow permissions video (at the 4m 43s mark), you must open the application Settings page instead (from there it is one click to the Permissions page).

To open the settings page, you would do

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