Android 2.2: Screen brightness/timeout question

Posted by Johan on Stack Overflow See other posts from Stack Overflow or by Johan
Published on 2011-01-08T13:04:22Z Indexed on 2011/02/07 15:25 UTC
Read the original article Hit count: 269

Filed under:
|

Im using the following code to adjust the brightness of the screen:

public void SetBright(float value) {
    Window mywindow = getWindow();
    WindowManager.LayoutParams lp = mywindow.getAttributes();

    lp.screenBrightness = value;
    mywindow.setAttributes(lp);        
}

But i want the brightness to be 0% for a specific time. But when i use SetBright(0.0f), i cant change it back. I made a timer that runs for a minute with 0% brightness, then turns it back to 100%. Works when i use 10% for example. But when i turn it to 0% i cant seem to wake it up again. Any ideas how to solve this?

© Stack Overflow or respective owner

Related posts about android

Related posts about screen-brightness