What device are you running on?  Setting an explicit screen brightness
definitely causes the screen to follow that on my Nexus One (as long as that
window is in control of the screen, of course).  Also in case it is not
clear -- FLAG_KEEP_SCREEN_ON is unrelated to the brightness control.

On Fri, Oct 1, 2010 at 7:22 AM, kevindroid <[email protected]> wrote:

> I have written the code to turn screen darker using the following
> code:
>        WindowManager.LayoutParams lp = getWindow().getAttributes();
>        lp.screenBrightness = (float) value / 100;
>        lp.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
>        getWindow().setAttributes(lp);
>
> It only works if the "auto screen brightness" is disabled.
>
> Hi I have no clue how to disable the "auto screen brightness" in
> settings? Please anyone help me.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to