How to handle SCREEN_OFF/_ON
Dear All,
I'm trying to write a program to handle the ACTION_SCREEN_OFF & ACTION_SCREEN_ON as mentioned in the Chapter-5 [Intnets, Boardcast Receivers, Adapter, and the Internet] in "Professional Android 2 Application Development" book.
Could someone please help me with explaining this with some small eample code, as it's very urgent for me.
I want to display an AlertDialog when the device is going to Sleep mode. So, I want to catch SCREEN_OFF event. I tried to create a <receiver> in Manifest file with "SCREEN_OFF" intent filter and implemented the creation of dialog code in onReceive() of that BroadcastReceiver class implementation.
What's wrong in this implementation and how do I need to do this??
Thanks in advance,
Kind Regards,
Durga
|