Disable keep screen on

后端 未结 4 1487
难免孤独
难免孤独 2020-12-02 21:44

I used:

getWindow().addFlags(android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

How do I resume to Default state (no-keep-on)?

4条回答
  •  感动是毒
    2020-12-02 22:31

    If you instead set a flag android:keepScreenOn="true" (documentation) only on the views that need to keep the screen on, you wouldn't need to reset the flag manually.

提交回复
热议问题