views:

45

answers:

1

Is there a way to retrieve the the amount of time since the battery has been charged?

It doesn't appear like there is a way to do so with BatteryManager, but they show it to you in the settings. I see it here source , but it doesn't appear like there is a way to grab it. Any help?

A: 

You can setup a broadcast receiver for ACTION_POWER_DISCONNECTED, and keep track of the last time it was broadcast.

h0b0
but I would like it to grab the correct time even the first time the app is installed and ran
John