Teo Choong Ping
Teo Choong Ping

Reputation: 12808

Get last battery charge date time from BatterManager

How do I get the last charge date/time from Android BatteryManager? Well maybe it's not BatteryManager but some other API to use for this.

I want to display something like "Charged 2 hours ago".

Upvotes: 2

Views: 1130

Answers (1)

nandeesh
nandeesh

Reputation: 24820

Register a broadcast reciever for ACTION_POWER_DISCONNECTED intent and then you could store the time at which power was disconnected.

Upvotes: 1

Related Questions