摘要:
在Activity的onCreate()中:PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock mWakeLock = pm.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "My Tag"); // onResume() 中调用:mWakeLock.acquire(); //onPause() 中调用释放WakeLock对象mWakeLock.release();方法二: use the 阅读全文