Thursday, October 28, 2010

[android-developers] Turn screen OFF/ON or change brightness screen

Hi all!

I'm trying to control to turn screen off/on. I'm using device HTC G1
(1.6).
to turn off screen I write:
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 0f;
getWindow().setAttributes(lp);

but if i want to turn on screen

lp.screenBrightness = 1f;
getWindow().setAttributes(lp);

screen not turn on. if lp.screenBrightness = 0.02f; screen change
bright, but not turn off.

Which right way to control by screen? Could 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate