A broadcast is sent when the screen goes on or off: http://code.google.com/android/reference/android/content/Intent.html#ACTION_SCREEN_OFF
Also the foreground activity only stays resumed while the screen is on. You should be able to use these to schedule your alarm during the desired time. On Tue, Jan 6, 2009 at 9:55 AM, ArtJin <[email protected]> wrote: > > Thank you for clarification Dianne. > I am trying to further optimize the app. > For example, if screen is off then the app does not really need to > connect to the server, but as soon as it turns on it should. > With this logic, I have no problem with AlarmManager working while CPU > is running, as long as I have this condition in the code. > Honestly, I am not sure if this is correct approach... > Related question would be how does my app know if screen is on or > off? :-) I do not see anything in PowerManager that allows this. > Any ideas would be greatly appreciated and thanks again Dianne! > > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

