1. You need to create a subclass of BroadcastReceiver, override onReceive(Context context, Intent intent). In onReceive(), extract action from intent and catch ACTION_SCREEN_ON and ACTION_SCREEN_OFF 2. Next you need to register the BroadcastReceiver in AndroidManifest.xml
On Jul 17, 12:02 am, jiaoni <[email protected]> wrote: > How can I catch SCREEN_ON/SCREEN_OFF broadcasts? > > I have tried for hours, but failed. Please help. > > Thanks a lot. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

