0

I'm trying to set System Screen Brightness instantaneously. I'm using a service to do that. Here it the code that I'm using.

Settings.System.putInt(cResolver,

Settings.System.SCREEN_BRIGHTNESS, 255);

This code works fine. But it is not instantaneous. The screen brightness value changes but the screen still looks dull. I can confirm this by reading back the screen brightness value and it is 255. If I lock the screen and come back, the screen is fully bright. How can I achieve this that the moment I set the system brightness to the maximum, I see fully bright screen?

BTW, I want to do this using a service and not an activity!

user135538
  • 3
  • 1
  • 1

1 Answers1

0

I would take a look at this link, specifically the first answer. It's a bit hackish though.

Changing screen brightness programmatically (as with the power widget)

Essentially you need to force the screen to refresh through starting a dummy activity and then finish() said dummy activity. I would have commented but I don't have enough points.

Community
  • 1
  • 1
TechnoloG
  • 56
  • 1
  • 7