-1

I have been looking around for a way to launch the Battery use (Setting-->Battery&performance-->Power usage) activity through my android app, but cannot find it.I want know how to start this Activity though an Action or Intent.

What is the action that I should pass into an Intent in order to get the Battery use(which show every apps usage of battery) screen to open up ?

I try to read the guide which Google provide, but I failed.

Intent intent = new Intent(?????); startActivity(intent);

I only want to start this Activity.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

2 Answers2

1

use

Intent intent = new Intent(Intent.ACTION_POWER_USAGE_SUMMARY);
startActivity(intent );
Vinay
  • 732
  • 5
  • 8
0

You can use this -

IntentFilter ifilter = new 
IntentFilter(Intent.ACTION_BATTERY_CHANGED);
Intent batteryStatus = context.registerReceiver(null, ifilter);
Anupam
  • 2,845
  • 2
  • 16
  • 30