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
You can try adding this inside your activity.
IntentFilter filter = new IntentFilter(); filter.addAction(Intent.ACTION_SCREEN_OFF); BroadcastReceiver mReceiver = new ScreenReceiver(); registerReceiver(mReceiver, filter);
Similarly you can add for ACTION_SCREEN_ON also
ACTION_SCREEN_ON