boroloro
boroloro

Reputation: 133

Get active time for device

How can I count active time for device? It's a time when device not sleeping(when the screen is ON). SystemClock.uptimeMillis() not suitable because it does not count only the time for deep sleeping.

Upvotes: 0

Views: 176

Answers (1)

crazyPixel
crazyPixel

Reputation: 2330

For screen on-off state, you can try with ACTION_SCREEN_ON and ACTION_SCREEN_OFF intents, as shown in this blog post: http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/

Upvotes: 1

Related Questions