赞
踩
//判断屏幕是否处于唤醒状态
if (!PMUtils.isScreenOn(AppApplication.getAppContext())){
//唤醒屏幕
PMUtils.wakeAndUnlock(AppApplication.getAppContext());
}
工具类
public class PMUtils {
public static boolean isScreenOn(Context context) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
if (pm.isScreenOn()) {
return true;
}
return
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。