In Lollipop version of android we have Battery saver activity in Settings->Battery->(in action overflow)Battery saver activity. I want to open this activity programatically. Which intent I have to use?
Thanks in advance!!!
try the following intent:
Intent batterySaverIntent=new Intent(Settings.ACTION_BATTERY_SAVER_SETTINGS);
startActivity(batterySaverIntent);
Or
Intent battSaverIntent = new Intent();
battSaverIntent.setComponent(new ComponentName("com.android.settings", "com.android.settings.Settings$BatterySaverSettingsActivity"));
startActivityForResult(battSaverIntent, 0);
for documentation open the following link here
Use the documented action string:
startActivity(new Intent(Settings.ACTION_BATTERY_SAVER_SETTINGS))
Note that this action string is new to API Level 22. You are welcome to try using it on older devices, but it is less likely that there will be an activity that supports it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With