How can i wake the android device using a wakelock? Or is this not possible and must i use alarm manager?
This does not work
new Handler().postDelayed(new Runnable() {
public void run() {
PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE);
WakeLock wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK|PowerManager.ACQUIRE_CAUSES_WAKEUP, "bbbb");
wl.acquire();
wl.release();
}
}, 10000);
Handler is used to run the following code after i have time to turn off the display.
AlarmManager
only works at a certain time and not at a certain line of code. Like, i can't have a notification wake the device usingAlarmManager
– Seth May 8 '13 at 22:17