How to Stop Automatic Sleep on Android Devices

Asked 2 years ago, Updated 2 years ago, 99 views

If you turn on the screen of the device and stay still on, the screen turns off automatically. I want to stop this, but I don't know what to do. Do you know anyone?

android screen

2022-09-22 21:58

1 Answers

In the onCreate() part, getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); You can add that.


2022-09-22 21:58

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.