Turn on screen programmatically

Put your problem here if it does not fit any of the other categories.

Turn on screen programmatically

Postby element56 » Tue Jun 22, 2010 5:14 pm

Hi there, I'm trying to accomplish a seemingly simple task without much luck. My use case is as follows: the user will set an alarm in my app for a certain time, then presumably the screen will be turned off. What I'd like to do is automatically turn on (unlock) the screen when the alarm goes off. I've tried acquring a wake lock but that doesn't seem to do it. Any ideas? Thanks in advance.

- Allan
element56
Freshman
Freshman
 
Posts: 7
Joined: Sun Feb 14, 2010 8:52 pm

Top

Re: Turn on screen programmatically

Postby anarche » Wed Jun 23, 2010 12:39 am

You don't need to wake the phone up. If you give a WAKEUP flag to the AlarmManager you use to fire the alarm it will automatically wake/turn on screen of the phone

http://developer.android.com/reference/ ... nager.html
anarche
Master Developer
Master Developer
 
Posts: 369
Joined: Sun Apr 11, 2010 5:21 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 26 guests