首页 > 解决方案 > Android 中的睡眠模式激活和禁用

问题描述

我想在 android 中休眠设备,并在 5 分钟后激活设备,禁用休眠模式,当我尝试下面的代码时,它可以工作并使用下面的代码进入休眠模式

android.provider.Settings.System.putInt(context.getContentResolver(),Settings.System.SCREEN_OFF_TIMEOUT,miliseconds);

当我尝试禁用睡眠模式和操作设备时,它不会激活设备如何在 android 中激活和禁用睡眠模式?

android.provider.Settings.System.putInt(context.getContentResolver(),Settings.System.SCREEN_BRIGHTNESS,miliseconds);

标签: androidsleep-mode

解决方案


推荐阅读