Hi everybody.

I use Android SDK 1.5

I want to set system screen bright but not activity because I run as
service.

I tried

android.provider.Settings.System.putInt(getContentResolver(),
android.provider.Settings.System.SCREEN_BRIGHTNESS,0);

but it's not working
the screen bright has no any change

and I tried

 WindowManager.LayoutParams lp = getWindow().getAttributes();
    lp.screenBrightness = 1.0f;
    getWindow().setAttributes(lp);

it can work in avtivity but in service there's no getWindow() function
so I can't use this method

so how can i adjust screen bright immediate in service?(i want to
adjust screen bright for all system not only in activity)

By the way , in PowerManager Class there's a goToSleep() function but
when i call this function,it happen SecurityException ,but i already
add    <uses-permission android:name="android.permission.DEVICE_POWER"/
> to AndroidManifest.xml.
I have search in android develop group and  there has same issues ,
but i don't know how to solve.
Thanks.

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to