//常亮
@SuppressLint("InvalidWakeLockTag")
public void onWakeLock()
{
PowerManager pManager =null;
if(pManager==null)
{
pManager = ((PowerManager) mContext.getSystemService(mContext.POWER_SERVICE));
}
mWakeLock = pManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK
| PowerManager.ON_AFTER_RELEASE, TAG);
mWakeLock.acquire();
}
//熄屏
public void unWakeLock()
{
if(null != mWakeLock){
mWakeLock.release();
}
}
android屏幕常量
![](https://img-home.csdnimg.cn/images/20240711042549.png)