Android WakeLock and KeyGuard
Posted
by KimAMartinsen
on Stack Overflow
See other posts from Stack Overflow
or by KimAMartinsen
Published on 2010-06-07T21:03:48Z
Indexed on
2010/06/07
21:12 UTC
Read the original article
Hit count: 557
android
Hi!
I'm just wondering if I do this correctly; I'm programming a notification app which can display a notification when the phone is sleeping
- Disable keyguard lock
- Aquire a wake lock
- show notification
- Set alarm for timeout and reenabling keyguard and release wakelock is the user dont touches the screen. 4.1 User touches the screen, and I disable the timer. Do nothing more. Done and done 4.2 User dont touch the screen, so reenable keyguard and release wakelock. Phone sleeps again
Basically I'm wondering about point 4.1 the most. cancel the pendingintent for the alarm, and do nothing more? or should the keyguard and wakelock that are set be dealt with in some way?
© Stack Overflow or respective owner