How to open Manage apps battery usage settings in MIUI devices
Asked Answered
D

1

7

How to open Manage apps battery usage settings in MIUI devices programmatically?

I open the settings by this:

startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0);

But I don't know how to open Manage apps battery usage settings in MIUI devices.

Demitria answered 16/9, 2017 at 8:43 Comment(5)
Did you try this solution? #20000333Spotweld
I not try to open settings Or Info i wanna to open Manage apps battery usage settings in MIUI devices?Demitria
Hi @Boris Treukhov and Lila saad have you checked my answer below?Category
I have tested it but MIUI has custom power manager anyway.Corsiglia
could you share a screenshot of MIUI custom power manager. I am having MIUI device with Android 6.0.1Category
C
5

You can try few methods below:

Personally i don't have 5.1 devices but tried it over simulator

    Intent batterySaver = new Intent();
    battSaverIntent.setComponent(new ComponentName("com.android.settings", "com.android.settings.Settings$BatterySaverSettingsActivity"));
    startActivityForResult(batterySaver, 0);

or for summary usage

Intent batterySaver = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
startActivity(batterySaver);

Documentation link here

For API level >22

startActivityForResult(new Intent(Settings.ACTION_BATTERY_SAVER_SETTINGS), 0);
Category answered 9/2, 2018 at 10:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.