Jeff,
What would the behavior be if you registered the broadcast receiver and listed these intents in the manifest? Would the run time start the service to invoke the onReceive() method? If so this is a great tip for optimization. Thanks On May 29, 1:38 pm, Jeff Sharkey <jshar...@android.com> wrote: > > I've dug through the documentation but couldn't find a call that would > > fit: Is there a way to find out the screen status (Active/dark)? > > You can listen for Intent.ACTION_SCREEN_OFF and ACTION_SCREEN_ON > broadcasts. However, I would strongly recommend registering for these > dynamically at runtime using Context.registerReceiver(). This ensures > that you'll only receive the broadcasts if your Service is already > awake, which is what you want. :) > > -- > Jeff Sharkey > jshar...@android.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---