5

I know there is many question about it already.
But today I found this:

enter image description here

enter image description here

My phone is Gallaxy Note 4 and Samsung Gallery app works just as I want 'open App permissions page from Activity!' not setting-detail page.

Anyone knows how to do that?

3
  • stackoverflow.com/questions/31127116/… Commented May 7, 2016 at 14:43
  • @Daniel Did you find solution to this? Commented Dec 11, 2018 at 11:09
  • have you found any solution yet? Commented Sep 13, 2021 at 10:22

1 Answer 1

8

Here is a method to open Settings > Permissions for your application:

public static void openPermissionSettings(Activity activity) { Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + activity.getPackageName())); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); activity.startActivity(intent); } 

You should consider using this when your permission is denied and shouldShowRequestPermissionRationale(Activity activity, String permission) returns true.

Sign up to request clarification or add additional context in comments.

2 Comments

how to open the permissions screen for a particular application...i have tried this code - Intent intent = new Intent("miui.intent.action.APP_PERM_EDITOR"); intent.setClassName("com.android.settings", "com.miui.securitycenter.permission.AppPermissionsEditor"); intent.putExtra("extra_package_uid", pInfo.applicationInfo.uid);
This is opening App Detail Settings page instead of App permissions page, there is still one click away from the destination.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.