1, Android screen illuminated steady/light
Copy Code code as follows:
Keep Screen illuminated steady
PowerManager pm = (powermanager) getsystemservice (Context.power_service);
Mwakelock = Pm.newwakelock (Powermanager.full_wake_lock | Powermanager.acquire_causes_wakeup, Lock_tag);
Mwakelock.acquire ();
Copy Code code as follows:
Release screen illuminated steady lock
if (null!= mwakelock) {
Mwakelock.release ();
}
2, Android screen unlock and lock
Copy Code code as follows:
Screen unlock
Keyguardmanager Keyguardmanager = (keyguardmanager) getsystemservice (Keyguard_service);
Keyguardlock Keyguardlock = Keyguardmanager.newkeyguardlock (Lock_tag);
Keyguardlock.disablekeyguard ();
Screen lock
Keyguardlock.reenablekeyguard ();
3. Related Rights
Copy Code code as follows:
<uses-permission android:name= "Android.permission.DISABLE_KEYGUARD"/>
<uses-permission android:name= "Android.permission.WAKE_LOCK"/>