I just wondered if (app is closed) there is a way to get notified when:
- The screen turns on/off,
- Another app starts/was closed.
I already found some hacky ways that might work, but they dont seem to be quite confidential. Some of them seem to only work on some phones. I am looking for "clean" way that works on all phones.
Why I would like to know that:
- To track the time I am spending during the day on my phone,
- To be able close the system alert window if a user opens another app.
Cheers :)
I am doing it that way now
http://stackoverflow.com/questions/16161062/broadcastreceiver-for-screen-on-off-not-working – user3254639 Jul 31 '14 at 17:19