Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable keep screen on

Tags:

android

flags

I used:

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

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

like image 503
OkyDokyman Avatar asked Jan 26 '11 17:01

OkyDokyman


People also ask

How do I stop my screen from turning off?

All you need to do is click on the settings menu from the notification panel or the app drawer and go to the settings icon. Now click on the Display icon. Click on Screen Timeout and click on the Never option. After Clicking on Screen timeout your phone screen will stop turning off.

How do I stop my computer screen from timing out?

Click on the “Change advanced power settings” link at the bottom of the page. A new window should pop up. Scroll down until you see Display, then click on the plus icon to expand the section. Change “Console lock display off timeout” to the number of minutes you want before your lock screen goes into a timeout.


1 Answers

I think this should do it:

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

See API for details.

like image 116
Noel Avatar answered Oct 17 '22 21:10

Noel