4

We know that Huawei and Xiaomi have 'protected apps option' in settings options, this option kills our apps when screen is off, then can't arrive notifications and others... I wanna warn my users about this option and open this settings part, it's possible to open an itent in this settings directory? Actually I open settings with this intent:

startActivity(new Intent(Settings.ACTION_SETTINGS));

Any idea? Thanks in advance!

  • See http://stackoverflow.com/questions/31638986/protected-apps-setting-on-huawei-phones-and-how-to-handle-it – David Wasser Dec 05 '16 at 14:50
  • If you can determine the class name of the settings screen, you can simply launch that `Activity`. It will be different for each manufacturer, and they can always change it in the future, so this isn't a very robust feature. – David Wasser Dec 05 '16 at 14:51

1 Answers1

1
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.huawei.systemmanager", "com.huawei.systemmanager.optimize.process.ProtectActivity"));
startActivity(intent);
Sabid Habib
  • 419
  • 1
  • 4
  • 16