Back to project page datacollection.
The source code is released under:
MIT License
If you think the Android project datacollection listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package edu.fordham.cis.wisdm.actipebble; /*from w ww .j ava 2 s.c o m*/ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; /** * Class to notify activities of when the screen locks and unlocks so it can be detected in onPause()\ * @author Andrew H. Johnston * @version 0.01ALPHA */ public class ScreenLockReceiver extends BroadcastReceiver { public static boolean wasScreenOn = true; @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) { wasScreenOn = false; } else { wasScreenOn = true; } } }