I want to create an activity that uses the intent action for Screen_off - is there an easy way to do this? I keep getting lost as to where I should start - does the screen_off activity need to be defined somewhere and then referred to?
+1
A:
There is no SCREEN_OFF activity. The SCREEN_OFF action is a broadcast. Further, it is not sent to applications that register through their manifest, so the only way to be called from it is to have something else running at the time that uses Context.registerReceiver() to receive that broadcast. (The reason for this is that turning the screen off and especially on needs to be fast, and allowing applications to be launched as part of that process can very easily cause a noticeable performance impact.)
hackbod
2010-10-23 17:34:39