Difference between Wakelock and FLAG_KEEP_SCREEN_ON?

前端 未结 3 1759
执笔经年
执笔经年 2020-12-28 12:37

Keeping the screen awake can be accomplished by using a wakelock by

mWakeLock = mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, 
                     


        
3条回答
  •  伪装坚强ぢ
    2020-12-28 13:11

    A wakelock gives you way more control (Like waking the phone to download something without turning the screen off) and requires your application to hold the wakelock permission.

    Therefore FLAG_KEEP_SCREEN_ON is recommended if all you want is to keep the screen on while your window is visible.

提交回复
热议问题