android - How to get the time for which screen is ON -


i working on android application warn user if screen been on long time. basic idea behind app warn user long exposure of eyes screen light. want time screen light turned on. if reaches limit then, user notified turn screen off time.

how time screen turned on?

reading documentation...

public static final string action_screen_off  added in api level 1 broadcast action: sent after screen turns off.  protected intent can sent system.  constant value: "android.intent.action.screen_off" 

public static final string action_screen_on added in api level 1 broadcast action: sent after screen turns on.  protected intent can sent system.  constant value: "android.intent.action.screen_on" 

when screen turned on keep track of current time , set alarm period of time , warn user.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -