0

Is there an intent to open the android "Priority only allows" screen? This is the screenshot I want to reach. Unfortunately, depending on the Android release, it might look very different. It is some confusion to the users to get to the right place:

enter image description here

For Android Pie is:

enter image description here

Paras Korat
  • 2,011
  • 2
  • 18
  • 36
Ton
  • 9,235
  • 15
  • 59
  • 103

1 Answers1

1

You can open the Priority only allows intent like this

  startActivityForResult(new Intent(Settings.ACTION_ZEN_MODE_PRIORITY_SETTINGS), 0);

I hope this helps you.

EDIT:

In the case of Android Pie you can try this

  startActivityForResult(new Intent(Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS), 0);
Amine
  • 2,241
  • 2
  • 19
  • 41
  • 1
    By the way, in the first screen you only see the Priority mode, in the second (which belongs to Android Pie) it displays that and also some Do not disturb settings behavior. Is there a way to access that in another intent for devices earlier than Pie? – Ton Mar 28 '19 at 11:21
  • Please take a look at edited answer and tell me what you've got. – Amine Mar 28 '19 at 13:14
  • Excuse me, in Huawei using Android 8 I get the error message "no activity found to handle ZEN_MODE_PRIORITY_SETTINGS" – Ton Apr 02 '19 at 19:43