Detect phone on sleep

Quickly share your Android Code Snippets here...

Detect phone on sleep

Postby csengyee » Sun Dec 20, 2009 4:54 am

Hi guys,

Is there a way to detect a phone entering into sleep mode? Thanks in advance.
csengyee
Junior Developer
Junior Developer
 
Posts: 19
Joined: Mon Jul 13, 2009 3:07 pm

Top

Postby i4nc4mp » Thu Dec 31, 2009 4:00 am

Yes. Just use a broadcast receiver for screen_off. I am doing this with a simple program that auto-bypasses the lockscreen activity.

Whats vexing me is whether I can have an activity watch for hardware buttons and handle them, while displaying just a sleeping screen
i4nc4mp
Developer
Developer
 
Posts: 39
Joined: Sat Dec 12, 2009 6:44 pm

Top

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 6 guests