Could someone please show me a sample code snippet where you use two bu开发者_JAVA百科ttons; one to turn off and one to turn on the screen. I cant get it to work. Thanks!
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
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.
精彩评论