Disable keep screen on

OkyDokyman picture OkyDokyman · Jan 26, 2011 · Viewed 27.9k times · Source

I used:

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

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

Answer

Noel picture Noel · Jan 26, 2011

I think this should do it:

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

See API for details.