Thursday, December 8, 2011

Check Screen timeout / KeyGuard Lock

Check for the Screen timeout or not!


PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);


if(pm.isScreenOn())
{
      Toast.makeText(this,"Screen is not locked", 20).show();
}else
     Toast.makeText(this,"Screen is time out", 20).show();



No comments:

Post a Comment