How to programmatically dismiss the screensaver/lock screen on Android (Nook Simple Touch)

后端 未结 1 1715
一向
一向 2021-01-22 20:40

I wrote a simple alarm-clock style application that I run on my (jailbroken) Nook Simple Touch (aka NST), under Android 2.1.

When the scheduled alarm time arrives, my ap

1条回答
  •  离开以前
    2021-01-22 21:33

    Ha, I figured out (with some more help from previous StackOverflow answers) what I was doing wrong.

    The problem is as described in the above link -- the AlarmManager was calling my BroadcastReceiver as expected, and then my BroadcastReceiver would sendMessage() a Message to my AlarmHandler (as shown in the Alarm example I was cribbing from). But the Nook would go back to sleep immediately after onReceive() returned, which meant that the secondary handler never got called, and therefore my wakeUpTheScreen() method wasn't getting executed.

    I moved the wakeUpTheScreen() call so that it now gets called directly from the onReceived() method, and now the wakeup works as expected. :^)

    0 讨论(0)
提交回复
热议问题