Skip to content Skip to sidebar Skip to footer

How To Open Battery Use In About Device Part Of Settings Programatically In 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.

Solution 1:

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

Solution 2:

Try this..

Intent powerUsageIntent = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
ResolveInfo resolveInfo = getPackageManager().resolveActivity(powerUsageIntent, 0);             
if(resolveInfo != null){
         startActivity(powerUsageIntent);
}

Post a Comment for "How To Open Battery Use In About Device Part Of Settings Programatically In Android?"