views:

62

answers:

1

There are apparently at least three different techniques for changing screen brightness in the Android OS. Two of them no longer work post-cupcake and the third accepted technique evidently has a bug.

I would like to increase screen brightness at the start of a one-view activity then turn the brightness back to the user setting at the end of the activity. No buttons, no second view or second activity. Just a maxed brightness at start and a return to original brightness setting at the end of the activity.

The examples of the current technique using WindowManager.LayoutParams that I have located range from 2 lines of code

WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 100 / 100.0f;
getWindow().setAttributes(lp);

to several pages of source code and numerous activities.

Is there a simple example of maxing the screen brightness at start that someone can provide a link to?

Thank you for reading my question.

A: 

There aren't a lot of resources available for this, but i found this explanation:

http://www.tutorialforandroid.com/2009/01/changing-screen-brightness.html

Roflcoptr
Thank you for your answer. I had looked at that pre-cupcake link. There is also a broken link for a cupcake version on that page. The correct link is http://www.tutorialforandroid.com/2009/05/changing-screen-brightness.html
John
hmm thats exactly what youre already doing...
Roflcoptr