here i am trying to determine whether the screen is on or not but it doesn\'t seems to be working when press power lock/unlock button. Application works with no error but the co
Register your BroadcastReceiver in a backgroung Service for Intent.ACTION_SCREEN_ON and Intent.ACTION_SCREEN_OFF events. It worked for me.
BroadcastReceiver
Service
Intent.ACTION_SCREEN_ON
Intent.ACTION_SCREEN_OFF