0

Could someone please show me a sample code snippet where you use two buttons; one to turn off and one to turn on the screen. I cant get it to work. Thanks!

Johan
  • 2,149
  • 4
  • 21
  • 18
  • possible [duplicate](http://stackoverflow.com/questions/4620046/android-2-2-turning-of-screen-under-certain-times-of-the-day-by-code) – dave.c Jan 10 '11 at 12:42

2 Answers2

0

I don't understand your question properly. A wake lock is set in your application so that the device screen does not turn off after a particular span of time. how ever you are advised to use this FLAG_KEEP_SCREEN_ON flag and is the best way

Force Screen On

Community
  • 1
  • 1
DeRagan
  • 22,827
  • 6
  • 41
  • 50
  • Poor explanation, my bad. I would like a timer to turn on and off the screen at certain points of the day. For example: If (hourOfDay == 12) screen = on; else off – Johan Jan 10 '11 at 12:17
0

Erm, when the screen is off, how are you hoping to display a button? Unless you mean hardware buttons, in which case I think only the power button can turn the screen back on.

ShibbyUK
  • 1,501
  • 9
  • 12