FLAG_KEEP_SCREEN_ON not undimming the screen

344 views Asked by At

I'm using the following line of code on the onCreate() methods of my two activities:

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

The point of course, is to keep the screen turned on and undimmed.

The point is that if the screen is dimmed -not turned off- before one of my activities is launched, the screen will maintain it's dimming until the user touchs the activity. After the user interacts in any way (TouchEvent or something like that, I'm assuming) with the activity the device will undimm the screen and maintain it that way until the user leaves the activity.

Does anyone knows why this is happening and how can I undimm the screen of the device before setting the FLAG_KEEP_SCREEN_ON flag?

0

There are 0 answers