From an Android service (for example at onCreate time) how can I determine whether screen was on or off before receiving the first broadcast screen intent (that may never be triggered if screen was already off and user does not use its phone) ?
Asked
Active
Viewed 2,713 times
1 Answers
9
If you want to test if the screen is on, you can use http://developer.android.com/reference/android/os/PowerManager.html#isScreenOn() .

Nick Campion
- 10,479
- 3
- 44
- 58