Search code examples
javaandroidsamsung-mobilesamsung-galaxy

Samsung Galaxy Phones Constant for Do Not Disturb (Pie)


Does anyone know how to find the Samsung Galaxy phones equivalent constant to Settings.ACTION_ZEN_MODE_PRIORITY_SETTINGS? I have an app that crashes when Samsung users click on the button that is supposed to take them to Do Not Disturb System Settings. Thanks for any help!

My code which works on other devices is:

private void openAndroidSettings() {
startActivityForResult(new 
Intent(Settings.ACTION_ZEN_MODE_PRIORITY_SETTINGS), 0);
}

I can access Samsung devices through the Samsung Remote Test Lab, so if I need to look there, that will be fine.


Solution

  • This is the closest I can get for Samsung devices:

    startActivity(new Intent("android.settings.ZEN_MODE_SETTINGS"));
    

    or

    startActivityForResult(new Intent("android.settings.ZEN_MODE_SETTINGS"), 0);