如何在Android中以编程方式打开关于设备部分的电池使用? [英] How to open Battery Use in About Device part of Settings Programatically in android?

查看:179
本文介绍了如何在Android中以编程方式打开关于设备部分的电池使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Android应用程序,我想以编程方式打开关于设备部分设置中的电池使用意图。我正在使用以下代码。

i am developing an android app where i want to open the Battery use intent which is present in About device part of settings programatically. I am using the below code for it.

                 Intent i = new Intent();
                 i.setAction(android.provider.Settings.ACTION_DEVICE_INFO_SETTINGS);
                 startActivity(i);

以上代码打开关于设备意图。但我想打开设置的关于设备部分内的电池使用选项。没有得到如何做到这一点。请帮忙!谢谢!

The above code opens the About Device intent. But i want to open the Battery use option which is inside the About device part of Settings. Not getting how to do it. Please Help! Thanks!

推荐答案

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

这篇关于如何在Android中以编程方式打开关于设备部分的电池使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆